Initial commit

This commit is contained in:
janisslsm committed 2026-07-27 16:20:00 +03:00
commit af3b49f756
16065 files changed
+2938410

No files matched your search

@@ -0,0 +1,25 @@
/* Metro module 9622; source: utils/AnalyticsFeedItemSeenActionCreators.tsx; dependencies: [694, 2] */
function _fun75460(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#75460, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9808:6, offset: 0x01dadf71, size: 125 bytes, params: 8, frame: 17
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/AnalyticsFeedItemSeenActionCreators.tsx');
exports.markAnalyticsFeedItemSeen = markAnalyticsFeedItemSeen;
exports.markAnalyticsFeedItemUnseen = markAnalyticsFeedItemUnseen;
exports.flushAnalyticsFeedItems = flushAnalyticsFeedItems;
}
function markAnalyticsFeedItemSeen(a0, a1, a2) { // fn#75461, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9808:199, offset: 0x01dadfee, size: 71 bytes, params: 4, frame: 13
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'ANALYTICS_FEED_ITEM_SEEN', id: a0,
feedItemId: a1, timestampMillis: a2});
}
function markAnalyticsFeedItemUnseen(a0, a1, a2) { // fn#75462, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9808:360, offset: 0x01dae035, size: 71 bytes, params: 4, frame: 13
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'ANALYTICS_FEED_ITEM_UNSEEN', id: a0,
feedItemId: a1, timestampMillis: a2});
}
function flushAnalyticsFeedItems(a0, a1) { // fn#75463, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9808:521, offset: 0x01dae07c, size: 63 bytes, params: 3, frame: 13
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'ANALYTICS_FEED_FLUSH', id: a0,
force: a1});
}
@@ -0,0 +1,583 @@
/* Metro module 9624; source: utils/AnalyticsFeedItemSeenManager.tsx; dependencies: [5, 6, 7, 44, 694, 2] */
function _fun75475(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#75475, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:6, offset: 0x01dae504, size: 273 bytes, params: 8, frame: 20
const _arrayLikeToArray_75478 = 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 Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(5) /* metro dependency 5 */;
const env0_3 = importDefault(6) /* metro dependency 6 */;
const env0_4 = importDefault(7) /* metro dependency 7 */;
const object = {IMMEDIATE: 0};
object[0] = 'IMMEDIATE';
object.IMMEDIATE_WITH_COOLDOWN = 1;
object[1] = 'IMMEDIATE_WITH_COOLDOWN';
object.IMMEDIATE_WITH_DELAY = 2;
object[2] = 'IMMEDIATE_WITH_DELAY';
let value = _fun75479();
let value2 = _fun75485();
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/AnalyticsFeedItemSeenManager.tsx');
exports.AnalyticsFeedTypes = {FORUM_CHANNEL: 'forum_channel'};
exports.ForceFlushType = object;
exports.TrackedFeedItem = value;
exports.AnalyticsFeedItemSeenManager = value2;
}
function _createForOfIteratorHelperLoose_75476(a0, a1) { // fn#75476, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:130, offset: 0x01dae615, size: 372 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 _fun75477;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_75478(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_75478(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_75478(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun75477;
}
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 _fun75479() { // fn#75479, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:1271, offset: 0x01dae789, size: 140 bytes, params: 1, frame: 15
return env0_4(TrackedFeedItem, [{key: 'maybeMarkSeen', value: function(a0) {
var r0;
var property = this.seenIntervals;
property = property[this.seenIntervals.length - 1];
r0 = property == null || property.endTimeMillis != null;
if (r0) {
this.seenIntervals.push({startTimeMillis: a0});
r0 = true;
}
return r0;
}}, {key: 'maybeMarkUnseen', value: function(a0) {
var r0;
var property = this.seenIntervals;
property = property[this.seenIntervals.length - 1];
r0 = property != null && property.endTimeMillis == null;
if (r0) {
property.endTimeMillis = a0;
r0 = true;
}
return r0;
}}, {key: 'isVisible', value: function() {
var property = this.seenIntervals;
property = property[this.seenIntervals.length - 1];
var value = undefined;
return (property == null ? value : property.startTimeMillis) != null && (property == null ? value : property.endTimeMillis) == null;
}}, {key: 'computeSeenTimeDestructive', value: value_75484}]);
}
function _fun75485() { // fn#75485, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:2319, offset: 0x01daea11, size: 59 bytes, params: 1, frame: 14
return env0_4(AnalyticsFeedItemSeenManager, [{key: 'maybeFlushSeenItems', value: value_75503}]);
}
function TrackedFeedItem() { // fn#75480, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:1292, offset: 0x01dae815, size: 37 bytes, params: 1, frame: 13
env1_3(this, TrackedFeedItem);
this.seenIntervals = [];
}
function value_75484(a0) { // fn#75484, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:1930, offset: 0x01dae91b, size: 246 bytes, params: 2, frame: 25
var r6;
var r8;
var r12;
var r2;
var value5;
var endTimeMillis;
var startTimeMillis;
var value6;
var Date;
var value7;
var value8;
var value9;
const items2 = [];
const value = environment.__proto__;
const value2 = _createForOfIteratorHelperLoose_75476(this.seenIntervals);
const value3 = value2();
let done = value3.done;
const value4 = 0;
if (done) {
r2 = value4;
} else {
r6 = value4;
r8 = value3;
while (true) {
value5 = r8.value;
endTimeMillis = value5.endTimeMillis;
if (endTimeMillis == null) {
if (a0) {
Date = global.Date;
value7 = Date.now();
value8 = r6 + (value7 - value5.startTimeMillis);
items2.push({startTimeMillis: value7});
r12 = value8;
break;
}
items2.push(value5);
r12 = r6;
break;
}
endTimeMillis = value5.endTimeMillis;
startTimeMillis = value5.startTimeMillis;
value6 = r6 + (endTimeMillis - startTimeMillis);
r12 = value6;
value9 = value2();
done = value9.done;
if (done) {
r2 = r12;
break;
}
r6 = r12;
r8 = value9;
continue;
}
}
(importDefault(44) /* metro dependency 44 */)(items2.length < 2, 'there should only be a single left over data');
this.seenIntervals = items2;
const Math = global.Math;
return Math.round(r2);
}
function AnalyticsFeedItemSeenManager({id, windowId, isPaused}) { // fn#75486, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:2340, offset: 0x01daea4c, size: 323 bytes, params: 2, frame: 17
var environment;
const value = environment.__proto__;
env1_3(this, AnalyticsFeedItemSeenManager);
this.initialize = initialize_75487;
this.terminate = terminate_75488;
this.handleFeedItemFlush = handleFeedItemFlush;
this.handleFeedItemSeen = handleFeedItemSeen;
this.handleFeedItemUnseen = handleFeedItemUnseen;
this.getTrackedFeedItem = getTrackedFeedItem;
this.getVisibleFeedItemIds = getVisibleFeedItemIds;
this.handleAppStateUpdate = handleAppStateUpdate_75495;
this.clearPausedFeedItemIds = clearPausedFeedItemIds;
this.pause = pause_75497;
this.resume = resume_75499;
this.handleReactNavigationFocus = handleReactNavigationFocus;
this.handleWindowFocus = handleWindowFocus_75502;
this.trackedFeedItems = {};
this._id = id;
this._windowId = windowId;
const Set = global.Set;
this._pausedFeedItemIds = new Set();
this._paused = isPaused != null && isPaused;
this._isReactNavigationFocused = true;
const Date = global.Date;
this._lastFlushTimeMillis = Date.now();
}
function value_75503(a0) { // fn#75503, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:5398, offset: 0x01daf1a7, size: 313 bytes, params: 2, frame: 17
var environment;
var r2;
var Date;
var value;
var Promise;
if (a0 != null) {
value = environment.__proto__;
if (a0 !== env1_5.IMMEDIATE_WITH_COOLDOWN) {
if (this.createFlushSeenItemsFunction(a0) == null) {
r2 = global.Promise.resolve();
} else {
Date = global.Date;
this._lastFlushTimeMillis = Date.now();
if (a0 === env1_5.IMMEDIATE) {
Promise = global.Promise;
value = _fun75504();
r2 = new Promise();
} else if (a0 === env1_5.IMMEDIATE_WITH_COOLDOWN) {
Promise = global.Promise;
value = _fun75504();
r2 = new Promise();
} else {
r2 = new global.Promise(_fun75508);
}
}
return r2;
}
} else {
Date = global.Date;
if (Date.now() - this._lastFlushTimeMillis < 60000) {
return global.Promise.resolve();
}
value = environment.__proto__;
if (a0 !== env1_5.IMMEDIATE_WITH_COOLDOWN) {
if (this.createFlushSeenItemsFunction(a0) == null) {
r2 = global.Promise.resolve();
} else {
Date = global.Date;
this._lastFlushTimeMillis = Date.now();
if (a0 === env1_5.IMMEDIATE) {
Promise = global.Promise;
value = _fun75504();
r2 = new Promise();
} else if (a0 === env1_5.IMMEDIATE_WITH_COOLDOWN) {
Promise = global.Promise;
value = _fun75504();
r2 = new Promise();
} else {
r2 = new global.Promise(_fun75508);
}
}
return r2;
}
}
Date = global.Date;
if (Date.now() - this._lastFlushTimeMillis < 3000) {
return global.Promise.resolve();
}
if (this.createFlushSeenItemsFunction(a0) == null) {
r2 = global.Promise.resolve();
} else {
Date = global.Date;
this._lastFlushTimeMillis = Date.now();
if (a0 === env1_5.IMMEDIATE) {
Promise = global.Promise;
value = _fun75504();
r2 = new Promise();
} else if (a0 === env1_5.IMMEDIATE_WITH_COOLDOWN) {
Promise = global.Promise;
value = _fun75504();
r2 = new Promise();
} else {
r2 = new global.Promise(_fun75508);
}
}
return r2;
}
function AnalyticsFeedItemSeenManagerInitialize() { // fn#75487, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:2461, owner: AnalyticsFeedItemSeenManager.initialize, offset: 0x01daeb8f, size: 214 bytes, params: 1, frame: 19
let value = environment.__proto__.__proto__;
value = importDefault(694) /* metro dependency 694: Dispatcher */;
const subscribe = value.subscribe;
const binding = env0_0;
Reflect.apply(subscribe, value, ['ANALYTICS_FEED_ITEM_SEEN', binding.handleFeedItemSeen]);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.subscribe('ANALYTICS_FEED_ITEM_UNSEEN', binding.handleFeedItemUnseen);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.subscribe('ANALYTICS_FEED_FLUSH', binding.handleFeedItemFlush);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.subscribe('APP_STATE_UPDATE', binding.handleAppStateUpdate);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.subscribe('WINDOW_FOCUS', binding.handleWindowFocus);
const onInitialize = binding.onInitialize;
if (onInitialize != null) {
onInitialize.call(env0_0);
}
}
function AnalyticsFeedItemSeenManagerTerminate() { // fn#75488, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:2862, owner: AnalyticsFeedItemSeenManager.terminate, offset: 0x01daec65, size: 239 bytes, params: 1, frame: 20
const defaultImport = importDefault(694) /* metro dependency 694: Dispatcher */;
const unsubscribe = defaultImport.unsubscribe;
let binding = env0_0;
Reflect.apply(unsubscribe, defaultImport, ['ANALYTICS_FEED_ITEM_SEEN', binding.handleFeedItemSeen]);
const defaultImport2 = defaultImport;
defaultImport2.unsubscribe('ANALYTICS_FEED_ITEM_UNSEEN', binding.handleFeedItemUnseen);
const defaultImport3 = defaultImport;
defaultImport3.unsubscribe('ANALYTICS_FEED_FLUSH', binding.handleFeedItemFlush);
const defaultImport4 = defaultImport;
defaultImport4.unsubscribe('APP_STATE_UPDATE', binding.handleAppStateUpdate);
const defaultImport5 = defaultImport;
defaultImport5.unsubscribe('WINDOW_FOCUS', binding.handleWindowFocus);
const onTerminate = binding.onTerminate;
if (onTerminate != null) {
onTerminate.call(env0_0);
}
binding = env0_0;
const maybeFlushSeenItems = binding.maybeFlushSeenItems;
const IMMEDIATE = env2_5.IMMEDIATE;
Reflect.apply(maybeFlushSeenItems, binding, [IMMEDIATE]);
}
function handleFeedItemFlush({id, force}) { // fn#75489, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:3320, owner: AnalyticsFeedItemSeenManager.handleFeedItemFlush, offset: 0x01daed54, size: 50 bytes, params: 2, frame: 12
if (env0_0._id === id) {
env0_0.maybeFlushSeenItems(force);
}
}
function handleFeedItemSeen({id, timestampMillis, feedItemId}) { // fn#75490, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:3406, owner: AnalyticsFeedItemSeenManager.handleFeedItemSeen, offset: 0x01daed86, size: 130 bytes, params: 2, frame: 16
var _paused;
var binding;
var value3;
var onFeedItemSeen;
if (id === env0_0._id) {
_paused = env0_0._paused;
binding = env0_0;
if (_paused) {
binding._pausedFeedItemIds.add(feedItemId);
} else {
value3 = binding.getTrackedFeedItem(feedItemId).maybeMarkSeen(timestampMillis);
onFeedItemSeen = binding.onFeedItemSeen;
if (onFeedItemSeen != null) {
onFeedItemSeen.call(env0_0, feedItemId, value3);
}
}
}
}
function handleFeedItemUnseen({id, timestampMillis, feedItemId}) { // fn#75491, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:3652, owner: AnalyticsFeedItemSeenManager.handleFeedItemUnseen, offset: 0x01daee08, size: 146 bytes, params: 2, frame: 16
var binding;
var value3;
var onFeedItemUnseen;
if (id === env0_0._id) {
if (env0_0._paused) {
env0_0._pausedFeedItemIds.delete(feedItemId);
}
binding = env0_0;
value3 = binding.getTrackedFeedItem(feedItemId).maybeMarkUnseen(timestampMillis);
onFeedItemUnseen = binding.onFeedItemUnseen;
if (onFeedItemUnseen != null) {
onFeedItemUnseen.call(env0_0, feedItemId, value3);
}
binding = env0_0;
binding.maybeFlushSeenItems();
}
}
function getTrackedFeedItem(a0) { // fn#75492, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:3924, owner: AnalyticsFeedItemSeenManager.getTrackedFeedItem, offset: 0x01daee9a, size: 83 bytes, params: 2, frame: 12
var value2;
var binding;
var value3;
var binding2;
let trackedFeedItems = env0_0.trackedFeedItems;
if (trackedFeedItems[a0] == null) {
trackedFeedItems = env0_0.trackedFeedItems;
value2 = environment.__proto__.__proto__;
binding = env2_6;
value3 = Object.create(binding.prototype, {constructor: {value: binding}});
binding2 = new binding();
trackedFeedItems[a0] = binding2 instanceof Object ? binding2 : value3;
}
return env0_0.trackedFeedItems[a0];
}
function getVisibleFeedItemIds() { // fn#75493, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:4046, owner: AnalyticsFeedItemSeenManager.getVisibleFeedItemIds, offset: 0x01daeeed, size: 78 bytes, params: 1, frame: 12
const Object = global.Object;
let value = Object.keys(env0_0.trackedFeedItems);
const Set = global.Set;
value = value.filter(_fun75494);
const value2 = Object.create(Set.prototype, {constructor: {value: Set}});
const set = new Set();
return set instanceof Object ? set : value2;
}
function AnalyticsFeedItemSeenManagerHandleAppStateUpdate({state}) { // fn#75495, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:4221, owner: AnalyticsFeedItemSeenManager.handleAppStateUpdate, offset: 0x01daef66, size: 122 bytes, params: 2, frame: 11
var binding;
var maybeFlushSeenItems;
if (state === 'active' && env0_0._isReactNavigationFocused) {
env0_0.resume();
}
if (state === 'background') {
if (env0_0._isReactNavigationFocused) {
env0_0.pause();
}
binding = env0_0;
maybeFlushSeenItems = binding.maybeFlushSeenItems;
value = environment.__proto__.__proto__;
Reflect.apply(maybeFlushSeenItems, binding, [env2_5.IMMEDIATE]);
}
}
function clearPausedFeedItemIds() { // fn#75496, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:4427, owner: AnalyticsFeedItemSeenManager.clearPausedFeedItemIds, offset: 0x01daefe0, size: 53 bytes, params: 1, frame: 10
const binding = env0_0;
const Set = global.Set;
binding._pausedFeedItemIds = new Set();
binding._paused = false;
}
function AnalyticsFeedItemSeenManagerPause() { // fn#75497, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:4492, owner: AnalyticsFeedItemSeenManager.pause, offset: 0x01daf015, size: 67 bytes, params: 1, frame: 12
var binding;
var visibleFeedItemIds;
if (!env0_0._paused) {
binding = env0_0;
visibleFeedItemIds = binding.getVisibleFeedItemIds();
visibleFeedItemIds.forEach(_fun75498);
binding._paused = true;
binding._pausedFeedItemIds = visibleFeedItemIds;
}
}
function AnalyticsFeedItemSeenManagerResume() { // fn#75499, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:4739, owner: AnalyticsFeedItemSeenManager.resume, offset: 0x01daf0a2, size: 67 bytes, params: 1, frame: 12
var binding;
if (env0_0._paused) {
binding = env0_0;
binding._paused = false;
binding._pausedFeedItemIds.forEach(_fun75500);
binding.clearPausedFeedItemIds();
}
}
function handleReactNavigationFocus(a0) { // fn#75501, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:4990, owner: AnalyticsFeedItemSeenManager.handleReactNavigationFocus, offset: 0x01daf12f, size: 55 bytes, params: 2, frame: 10
let binding = env0_0;
binding._isReactNavigationFocused = a0;
const _isReactNavigationFocused = binding._isReactNavigationFocused;
binding = env0_0;
if (_isReactNavigationFocused) {
binding.resume();
} else {
binding.pause();
}
}
function AnalyticsFeedItemSeenManagerHandleWindowFocus(a0) { // fn#75502, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:5109, owner: AnalyticsFeedItemSeenManager.handleWindowFocus, offset: 0x01daf166, size: 65 bytes, params: 2, frame: 11
var focused;
var binding;
if (env0_0._windowId === a0.windowId) {
focused = a0.focused;
binding = env0_0;
if (focused) {
binding.resume();
} else {
binding.pause();
}
}
}
function _fun75504() { // fn#75504, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:5761, offset: 0x01daf2e0, size: 36 bytes, params: 1, frame: 12
const env0_0 = env2_2(_fun75506);
return _fun75507;
}
function _fun75508(a0) { // fn#75508, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:5878, offset: 0x01daf33d, size: 49 bytes, params: 2, frame: 13
var environment;
const env0_0 = a0;
const setTimeout = global.setTimeout;
const value = environment.__proto__.__proto__;
setTimeout(env2_2(_fun75510), 100);
}
function _fun75494(a0) { // fn#75494, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:4117, offset: 0x01daef3b, size: 43 bytes, params: 2, frame: 10
const value = environment.__proto__;
return env1_0.trackedFeedItems[a0]?.isVisible();
}
function _fun75498(a0) { // fn#75498, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:4561, offset: 0x01daf058, size: 74 bytes, params: 2, frame: 13
const binding = env1_0;
const handleFeedItemUnseen = binding.handleFeedItemUnseen;
const object2 = {};
object2.id = binding._id;
object2.feedItemId = a0;
const Date = global.Date;
object2.timestampMillis = Date.now();
object2.type = 'ANALYTICS_FEED_ITEM_UNSEEN';
Reflect.apply(handleFeedItemUnseen, binding, [object2]);
}
function _fun75500(a0) { // fn#75500, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:4808, offset: 0x01daf0e5, size: 74 bytes, params: 2, frame: 13
const binding = env1_0;
const handleFeedItemSeen = binding.handleFeedItemSeen;
const object2 = {};
object2.id = binding._id;
object2.feedItemId = a0;
const Date = global.Date;
object2.timestampMillis = Date.now();
object2.type = 'ANALYTICS_FEED_ITEM_SEEN';
Reflect.apply(handleFeedItemSeen, binding, [object2]);
}
function* _fun75506(a0) { // fn#75506, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:5781, offset: 0x01daf30f, size: 46 bytes, params: 2, frame: 11
if (true) {
value = environment.__proto__.__proto__;
yield AnalyticsFeedItemSeenManager();
if (false) {
return undefined;
}
a0();
}
}
function* _fun75510() { // fn#75510, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9810:5896, offset: 0x01daf379, size: 50 bytes, params: 1, frame: 11
if (true) {
value = environment.__proto__.__proto__;
yield AnalyticsFeedItemSeenManager();
if (false) {
return undefined;
}
value = environment.__proto__;
env1_0();
}
}
+6
View File
@@ -0,0 +1,6 @@
/* Metro module 12846; source: utils/AnalyticsSchema.tsx; dependencies: [661, 2] */
function _fun98000(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#98000, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13036:6, offset: 0x02198b00, size: 55 bytes, params: 8, frame: 12
(require(661) /* metro dependency 661: Constants */).AnalyticEvents;
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/AnalyticsSchema.tsx');
}
+499
View File
@@ -0,0 +1,499 @@
/* Metro module 683; source: utils/AnalyticsUtils.tsx; dependencies: [29, 31, 684, 691, 661, 12845, 4238, 1873, 682, 480, 12843, 1216, 694, 5256, 1244, 12, 491, 2, 12846] */
function _fun8281(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#8281, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:790:6, offset: 0x00d3dfba, size: 2592 bytes, params: 8, frame: 36
var object2;
var r9;
var value6;
var generateLaunchSignature;
var value7;
const env0_0 = require;
const closure = function(a0) {
return typeof a0 === 'string' ? {location: a0} : {location: a0.page, location_page: a0.page,
location_section: a0.section, location_object: a0.object, location_object_type: a0.objectType};
};
const expandSource = function(a0) {
return typeof a0 === 'string' ? {source: a0} : {source_page: a0.page, source_section: a0.section,
source_object: a0.object, source_object_type: a0.objectType, source_promotion_id: a0.promotionId};
};
const closure2 = addBreadcrumb;
const closure3 = expandEventProperties;
const closure4 = debugLogEvent;
const env0_4 = ['location'];
const env0_5 = ['source'];
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_6 = importDefault(29) /* metro dependency 29 */;
let value = importAll(31) /* metro dependency 31 */;
const impressionStoreModule = require(684) /* metro dependency 684: ImpressionStore */;
const env0_7 = impressionStoreModule.setDebugTrackedData;
const env0_8 = impressionStoreModule.getLocation;
const developerOptionsStore = importDefault(691) /* metro dependency 691: DeveloperOptionsStore */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const AnalyticEvents = constantsModule.AnalyticEvents;
const env0_10 = constantsModule.AnalyticsObjectTypes;
const env0_11 = constantsModule.AnalyticsSections;
const env0_12 = (require(12845) /* metro dependency 12845: AccessibilityConstants */).AccessibilityFeatureFlags;
const env0_13 = (require(4238) /* metro dependency 4238: ApplicationConstants */).ApplicationTypes;
value = value.createContext({location: {}});
let env0_14 = {};
const env0_16 = global.performance.now();
if ((require(1873) /* metro dependency 1873: shimNative */).isLibdiscoreInitialized()) {
value6 = require(1873) /* metro dependency 1873: shimNative */;
generateLaunchSignature = value6.generateLaunchSignature;
value7 = require(682) /* metro dependency 682: GlobalUtils */;
r9 = Reflect.apply(generateLaunchSignature, value6, [value7.getGlobalObject()]);
} else {
r9 = null;
}
const analyticsUtilsModule = importAll(480) /* metro dependency 480: AnalyticsUtils */;
analyticsUtilsModule.extendSuperProperties({launch_signature: r9});
const env0_18 = [];
object2 = {};
const APP_OPENED = AnalyticEvents.APP_OPENED;
object2[APP_OPENED] = {throttlePeriod: 300000, throttleKeys: function() {
return [];
}};
const APP_BACKGROUND = AnalyticEvents.APP_BACKGROUND;
object2[APP_BACKGROUND] = {throttlePeriod: 120000, throttleKeys: function() {
return [];
}};
const ACK_MESSAGES = AnalyticEvents.ACK_MESSAGES;
object2[ACK_MESSAGES] = _fun8290;
const GUILD_VIEWED = AnalyticEvents.GUILD_VIEWED;
object2[GUILD_VIEWED] = {throttlePeriod: 900000, throttleKeys: function(a0) {
return [a0.guild_id, a0.is_pending];
}};
const FRIENDS_LIST_VIEWED = AnalyticEvents.FRIENDS_LIST_VIEWED;
object2[FRIENDS_LIST_VIEWED] = {throttlePeriod: 900000, throttleKeys: function({tab_opened}) {
return [tab_opened];
}};
const NOW_PLAYING_CARD_HOVERED = AnalyticEvents.NOW_PLAYING_CARD_HOVERED;
object2[NOW_PLAYING_CARD_HOVERED] = {throttlePeriod: 900000, throttleKeys: function({tab_opened}) {
return [tab_opened];
}};
const START_SPEAKING = AnalyticEvents.START_SPEAKING;
object2[START_SPEAKING] = {throttlePeriod: 900000, throttleKeys: function({server}) {
return [server];
}};
const START_LISTENING = AnalyticEvents.START_LISTENING;
object2[START_LISTENING] = {throttlePeriod: 900000, throttleKeys: function({server}) {
return [server];
}};
const ACTIVITY_UPDATED = AnalyticEvents.ACTIVITY_UPDATED;
object2[ACTIVITY_UPDATED] = {'throttlePeriod': 60000, 'throttleKeys': null, 'deduplicate': true,
throttleKeys: function({application_id}) {
return [application_id];
}};
const CHANNEL_OPENED = AnalyticEvents.CHANNEL_OPENED;
object2[CHANNEL_OPENED] = {throttlePeriod: 900000, throttleKeys: function(a0) {
return a0.channel_static_route != null ? [a0.guild_id, a0.channel_static_route,
a0.channel_view] : [a0.channel_id,
a0.channel_view];
}};
const TEXT_IN_VOICE_OPENED = AnalyticEvents.TEXT_IN_VOICE_OPENED;
object2[TEXT_IN_VOICE_OPENED] = {throttlePeriod: 86400000, throttleKeys: function({channel_id}) {
return [channel_id];
}};
const NOTIFICATION_VIEWED = AnalyticEvents.NOTIFICATION_VIEWED;
object2[NOTIFICATION_VIEWED] = {throttlePeriod: 900000, throttleKeys: function({notif_type}) {
return [notif_type];
}};
const MEMBER_LIST_VIEWED = AnalyticEvents.MEMBER_LIST_VIEWED;
object2[MEMBER_LIST_VIEWED] = {throttlePeriod: 900000, throttleKeys: function({channel_id}) {
return [channel_id];
}};
const DM_LIST_VIEWED = AnalyticEvents.DM_LIST_VIEWED;
object2[DM_LIST_VIEWED] = {throttlePeriod: 900000, throttleKeys: function({channel_id}) {
return [channel_id];
}};
const NAV_DRAWER_OPENED = AnalyticEvents.NAV_DRAWER_OPENED;
object2[NAV_DRAWER_OPENED] = {throttlePeriod: 900000, throttleKeys: function() {
return [];
}};
const KEYBOARD_SHORTCUT_USED = AnalyticEvents.KEYBOARD_SHORTCUT_USED;
object2[KEYBOARD_SHORTCUT_USED] = {throttlePeriod: 120000, throttleKeys: function(a0) {
var r2;
var items = [a0.shortcut_name, a0.location_object];
r2 = a0.source_class_list ?? [];
arraySpread(items, r2, 2, r2);
return items;
}};
const QUICKSWITCHER_OPENED = AnalyticEvents.QUICKSWITCHER_OPENED;
object2[QUICKSWITCHER_OPENED] = {throttlePeriod: 10000, throttleKeys: function() {
return [];
}};
const CHAT_INPUT_COMPONENT_VIEWED = AnalyticEvents.CHAT_INPUT_COMPONENT_VIEWED;
object2[CHAT_INPUT_COMPONENT_VIEWED] = {throttlePeriod: 900000, throttleKeys: function({type}) {
return [type];
}};
const ROLE_PAGE_VIEWED = AnalyticEvents.ROLE_PAGE_VIEWED;
object2[ROLE_PAGE_VIEWED] = {throttlePeriod: 120000, throttleKeys: function(a0) {
return [a0.role_id, a0.tab_opened];
}};
const VIDEO_INPUT_INITIALIZED = AnalyticEvents.VIDEO_INPUT_INITIALIZED;
object2[VIDEO_INPUT_INITIALIZED] = {throttlePeriod: 300000, throttleKeys: function() {
return [];
}};
const AUDIO_INPUT_INITIALIZED = AnalyticEvents.AUDIO_INPUT_INITIALIZED;
object2[AUDIO_INPUT_INITIALIZED] = {throttlePeriod: 300000, throttleKeys: function() {
return [];
}};
const HUB_ONBOARDING_CAROUSEL_SCROLLED = AnalyticEvents.HUB_ONBOARDING_CAROUSEL_SCROLLED;
object2[HUB_ONBOARDING_CAROUSEL_SCROLLED] = {throttlePeriod: 900000, throttleKeys: function() {
return [];
}};
const HUB_STUDENT_PROMPT_CLICKED = AnalyticEvents.HUB_STUDENT_PROMPT_CLICKED;
object2[HUB_STUDENT_PROMPT_CLICKED] = {throttlePeriod: 900000, throttleKeys: function() {
return [];
}};
const RPC_SERVER_ERROR_CAUGHT = AnalyticEvents.RPC_SERVER_ERROR_CAUGHT;
object2[RPC_SERVER_ERROR_CAUGHT] = {throttlePeriod: 86400000, throttleKeys: function() {
return [];
}};
const RPC_COMMAND_SENT = AnalyticEvents.RPC_COMMAND_SENT;
object2[RPC_COMMAND_SENT] = {'throttlePeriod': 86400000, 'throttleKeys': null, 'throttlePercent': 0.001,
throttleKeys: function(a0) {
return [a0.application_id, a0.command];
}};
const RPC_SUBSCRIPTION_REQUESTED = AnalyticEvents.RPC_SUBSCRIPTION_REQUESTED;
object2[RPC_SUBSCRIPTION_REQUESTED] = {'throttlePeriod': 86400000, 'throttleKeys': null, 'throttlePercent': 0.001,
throttleKeys: function(a0) {
return [a0.application_id, a0.event];
}};
const ACTIVITY_HANDSHAKE = AnalyticEvents.ACTIVITY_HANDSHAKE;
object2[ACTIVITY_HANDSHAKE] = {throttlePeriod: 86400000, throttleKeys: function({application_id}) {
return [application_id];
}};
const CHANNEL_BANNER_VIEWED = AnalyticEvents.CHANNEL_BANNER_VIEWED;
object2[CHANNEL_BANNER_VIEWED] = {throttlePeriod: 86400000, throttleKeys: function(a0) {
return [a0.banner_type, a0.channel_id];
}};
const ImpressionNames = (require(480) /* metro dependency 480: AnalyticsUtils */).ImpressionNames;
const GUILD_HANGOUT_WINDOW = ImpressionNames.GUILD_HANGOUT_WINDOW;
object2[GUILD_HANGOUT_WINDOW] = {throttlePeriod: 86400000, throttleKeys: function(a0) {
return [a0.channel_id, a0.banner_hash];
}};
const GUILD_HANGOUT_WINDOW_ENTRY_POINT = ImpressionNames.GUILD_HANGOUT_WINDOW_ENTRY_POINT;
object2[GUILD_HANGOUT_WINDOW_ENTRY_POINT] = {throttlePeriod: 86400000, throttleKeys: function(a0) {
return [a0.channel_id, a0.media_session_id];
}};
const PREMIUM_UPSELL_VIEWED = AnalyticEvents.PREMIUM_UPSELL_VIEWED;
object2[PREMIUM_UPSELL_VIEWED] = {throttlePeriod: 60000, throttleKeys: function({type}) {
return [type];
}};
const FORUM_CHANNEL_SEARCHED = AnalyticEvents.FORUM_CHANNEL_SEARCHED;
object2[FORUM_CHANNEL_SEARCHED] = {throttlePeriod: 60000, throttleKeys: function(a0) {
return [a0.guild_id, a0.channel_id];
}};
const FORUM_CHANNEL_SCROLLED = AnalyticEvents.FORUM_CHANNEL_SCROLLED;
object2[FORUM_CHANNEL_SCROLLED] = {throttlePeriod: 900000, throttleKeys: function(a0) {
return [a0.guild_id, a0.channel_id];
}};
const VOICE_CHANNEL_GAME_ACTIVITY_INDICATOR_VIEWED = AnalyticEvents.VOICE_CHANNEL_GAME_ACTIVITY_INDICATOR_VIEWED;
object2[VOICE_CHANNEL_GAME_ACTIVITY_INDICATOR_VIEWED] = {throttlePeriod: 60000, throttleKeys: function({user_id}) {
return [user_id];
}};
const MEDIA_VIEWER_SESSION_COMPLETED = AnalyticEvents.MEDIA_VIEWER_SESSION_COMPLETED;
object2[MEDIA_VIEWER_SESSION_COMPLETED] = {throttlePeriod: 60000, throttleKeys: function() {
return [];
}};
const SUMMARIES_UNREAD_BAR_VIEWED = AnalyticEvents.SUMMARIES_UNREAD_BAR_VIEWED;
object2[SUMMARIES_UNREAD_BAR_VIEWED] = {throttlePeriod: 300000, throttleKeys: function({channel_id}) {
return [channel_id];
}};
const ACTIVITY_CARDS_VIEWED = AnalyticEvents.ACTIVITY_CARDS_VIEWED;
object2[ACTIVITY_CARDS_VIEWED] = {throttlePeriod: 900000, throttleKeys: function(a0) {
return [a0.context, a0.guild_id];
}};
const GUILD_TOOLTIP_SHOWN = AnalyticEvents.GUILD_TOOLTIP_SHOWN;
object2[GUILD_TOOLTIP_SHOWN] = {throttlePeriod: 900000, throttleKeys: function({guild_id}) {
return [guild_id];
}};
const ACK_COMMUNITY_MESSAGES = AnalyticEvents.ACK_COMMUNITY_MESSAGES;
object2[ACK_COMMUNITY_MESSAGES] = {throttlePeriod: 900000, throttleKeys: function({channel_id}) {
return [channel_id];
}};
const REDESIGN_NAV_BAR_CLICKED = AnalyticEvents.REDESIGN_NAV_BAR_CLICKED;
object2[REDESIGN_NAV_BAR_CLICKED] = {throttlePeriod: 900000, throttleKeys: function({tab}) {
return [tab];
}};
const CHANNEL_LIST_END_REACHED = AnalyticEvents.CHANNEL_LIST_END_REACHED;
object2[CHANNEL_LIST_END_REACHED] = {throttlePeriod: 900000, throttleKeys: function({guild_id}) {
return [guild_id];
}};
const EXPLICIT_MEDIA_REDACTABLE_MESSAGES_LOADED = AnalyticEvents.EXPLICIT_MEDIA_REDACTABLE_MESSAGES_LOADED;
object2[EXPLICIT_MEDIA_REDACTABLE_MESSAGES_LOADED] = {throttlePeriod: 60000, throttleKeys: function(a0) {
return [a0.guild_id, a0.channel_id];
}};
const LIVE_ACTIVITY_SETTINGS_UPDATED = AnalyticEvents.LIVE_ACTIVITY_SETTINGS_UPDATED;
object2[LIVE_ACTIVITY_SETTINGS_UPDATED] = {throttlePeriod: 3600000, throttleKeys: function() {
return [];
}};
const MEDIA_INPUT_VOLUME_CHANGED = AnalyticEvents.MEDIA_INPUT_VOLUME_CHANGED;
object2[MEDIA_INPUT_VOLUME_CHANGED] = {throttlePeriod: 300000, throttleKeys: function({location_stack}) {
return [location_stack];
}};
const MEDIA_OUTPUT_VOLUME_CHANGED = AnalyticEvents.MEDIA_OUTPUT_VOLUME_CHANGED;
object2[MEDIA_OUTPUT_VOLUME_CHANGED] = {throttlePeriod: 300000, throttleKeys: function({location_stack}) {
return [location_stack];
}};
const APP_DMS_QUICK_LAUNCHER_IMPRESSION = AnalyticEvents.APP_DMS_QUICK_LAUNCHER_IMPRESSION;
object2[APP_DMS_QUICK_LAUNCHER_IMPRESSION] = {throttlePeriod: 900000, throttleKeys: function({channel_id}) {
return [channel_id];
}};
const USER_VOICE_ACTIVITY_VIEWED = AnalyticEvents.USER_VOICE_ACTIVITY_VIEWED;
object2[USER_VOICE_ACTIVITY_VIEWED] = {'throttlePeriod': 300000, 'throttleKeys': null, 'deduplicate': true,
throttleKeys: function(a0) {
return [a0.activity_user_id, a0.surface];
}};
const PARTY_VOICE_ACTIVITY_VIEWED = AnalyticEvents.PARTY_VOICE_ACTIVITY_VIEWED;
object2[PARTY_VOICE_ACTIVITY_VIEWED] = {'throttlePeriod': 300000, 'throttleKeys': null, 'deduplicate': true,
throttleKeys: function({voice_channel_id}) {
return [voice_channel_id];
}};
const MEMBER_LIST_SWIPE_PEEK = AnalyticEvents.MEMBER_LIST_SWIPE_PEEK;
object2[MEMBER_LIST_SWIPE_PEEK] = {throttlePeriod: 1000, throttleKeys: function({channel_id}) {
return [channel_id];
}};
const REDACTABLE_MESSAGE_LOADED = AnalyticEvents.REDACTABLE_MESSAGE_LOADED;
object2[REDACTABLE_MESSAGE_LOADED] = {throttlePeriod: 900000, throttleKeys: function(a0) {
return [a0.channel_id, a0.message_id];
}};
const OPEN_MODAL = AnalyticEvents.OPEN_MODAL;
object2[OPEN_MODAL] = _fun8339;
const MODERATOR_QUEUE_ACTION = AnalyticEvents.MODERATOR_QUEUE_ACTION;
object2[MODERATOR_QUEUE_ACTION] = {throttlePeriod: 10000, throttleKeys: function({guild_id}) {
return [guild_id];
}};
const NOTIFICATION_PERMISSION_STATUS = AnalyticEvents.NOTIFICATION_PERMISSION_STATUS;
object2[NOTIFICATION_PERMISSION_STATUS] = {throttlePeriod: 43200000, throttleKeys: function(a0) {
return [a0.os_enabled, a0.notification_authorization_status, a0.foreground_app_enabled,
a0.background_app_enabled];
}};
const SEARCH_BAR_VIEWED = AnalyticEvents.SEARCH_BAR_VIEWED;
object2[SEARCH_BAR_VIEWED] = {throttlePeriod: 3600000, throttleKeys: function({search_type}) {
return [search_type];
}};
const AD_IDENTIFIER_FETCHED = AnalyticEvents.AD_IDENTIFIER_FETCHED;
object2[AD_IDENTIFIER_FETCHED] = {throttlePeriod: 86400000, throttleKeys: function() {
return [];
}};
const ACTIVITY_PANEL_SDK_LINK_VIEWED = AnalyticEvents.ACTIVITY_PANEL_SDK_LINK_VIEWED;
object2[ACTIVITY_PANEL_SDK_LINK_VIEWED] = {throttlePeriod: 86400000, throttleKeys: function({application_id}) {
return [application_id];
}};
const LIBDISCORE_SLOW_TIMERS = AnalyticEvents.LIBDISCORE_SLOW_TIMERS;
object2[LIBDISCORE_SLOW_TIMERS] = {throttlePeriod: 3600000, throttleKeys: function() {
return [];
}};
const VIDEO_STREAM_ZOOM_CHANGED = AnalyticEvents.VIDEO_STREAM_ZOOM_CHANGED;
object2[VIDEO_STREAM_ZOOM_CHANGED] = {throttlePeriod: 1000, throttleKeys: function() {
return [];
}};
const CACHE_STATS_RECORDED = AnalyticEvents.CACHE_STATS_RECORDED;
object2[CACHE_STATS_RECORDED] = {throttlePeriod: 900000, throttleKeys: function() {
return [];
}};
const getAccessibilityFeatures = function() {
return AccessibilityFeatureFlags.NONE;
};
const analyticsUtilsModule2 = require(480) /* metro dependency 480: AnalyticsUtils */;
const env0_20 = analyticsUtilsModule2.trackMaker({addBreadcrumb: closure2, analyticEventConfigs: object2,
dispatcher: importDefault(694) /* metro dependency 694: Dispatcher */, TRACK_ACTION_NAME: 'TRACK'});
const env0_22 = {};
const value11 = analyticsUtilsModule2;
const env0_23 = value11.trackMaker({addBreadcrumb: closure2, analyticEventConfigs: object2,
dispatcher: importDefault(694) /* metro dependency 694: Dispatcher */, TRACK_ACTION_NAME: 'TRACK'});
const object3 = {};
copyDataProperties(object3, analyticsUtilsModule, undefined);
const getCampaignParams = analyticsUtilsModule2.getCampaignParams;
object3['getCampaignParams'] = getCampaignParams;
object3['setSystemAccessibilityFeatures'] = function(a0) {
env0_19 = a0;
};
object3['expandEventProperties'] = closure3;
object3['track'] = track;
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/AnalyticsUtils.tsx');
exports.default = object3;
exports.AnalyticsContext = value;
exports.launchSignature = r9;
exports.addExtraAnalyticsDecorator = addExtraAnalyticsDecorator;
exports.AnalyticEventConfigs = object2;
exports.expandLocation = closure;
exports.setUTMContext = function(a0) {
env0_14 = a0;
return a0;
};
exports.expandEventProperties = closure3;
exports.debugLogEvent = closure4;
exports.startRecordingAnalyticsEvents = function() {
env0_21 = true;
};
exports.stopRecordingAnalyticsEvents = function() {
env0_21 = false;
};
exports.getAnalyticsEventsRecording = getAnalyticsEventsRecording;
exports.clearAnalyticsEventsRecording = clearAnalyticsEventsRecording;
exports.isGameApplicationType = isGameApplicationType;
exports.trackNetworkAction = trackNetworkAction;
exports.getNewAnalyticsLoadId = getNewAnalyticsLoadId;
exports.AnalyticsSchema = importAll(12846) /* metro dependency 12846: AnalyticsSchema */;
}
function addBreadcrumb(a0) { // fn#8284, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:790:6093, offset: 0x00d3ea81, size: 94 bytes, params: 2, frame: 14
const IGNORE_ANALYTICS_BREADCRUMB_EVENTS = (require(12843) /* metro dependency 12843: CommonSentryInitUtils */).IGNORE_ANALYTICS_BREADCRUMB_EVENTS;
if (!IGNORE_ANALYTICS_BREADCRUMB_EVENTS.includes(a0)) {
(importDefault(1216) /* metro dependency 1216: SentryUtilsNative */).addBreadcrumb({category: 'analytics',
message: a0});
}
}
function expandEventProperties(a0) { // fn#8285, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:790:6358, offset: 0x00d3eadf, size: 528 bytes, params: 2, frame: 22
var r8;
var r0;
var object2;
var value2;
var value3;
const r7 = a0 ?? ({});
let location = r7.location;
if (location == null) {
r8 = r7;
} else {
location = r7.location;
value2 = env0_6(r7, env0_4);
object2 = {};
copyDataProperties(object2, value2, undefined);
copyDataProperties(object2, expandLocation(location), undefined);
r8 = object2;
}
let source = r8.source;
if (source == null) {
r0 = r8;
} else {
source = r8.source;
value3 = env0_6(r8, env0_5);
object2 = {};
copyDataProperties(object2, value3, undefined);
copyDataProperties(object2, expandSource(source), undefined);
r0 = object2;
}
r0.client_performance_cpu = (importDefault(5256) /* metro dependency 5256: ProcessUtilsNative */).getCurrentCPUUsagePercent();
r0.client_performance_memory = (importDefault(5256) /* metro dependency 5256: ProcessUtilsNative */).getCurrentMemoryUsageKB();
r0.cpu_core_count = (importDefault(5256) /* metro dependency 5256: ProcessUtilsNative */).getCPUCoreCount();
r0.accessibility_features = getAccessibilityFeatures();
r0.rendered_locale = (require(1244) /* metro dependency 1244: indexNative */).intl.currentLocale;
const Math = global.Math;
r0.uptime_app = Math.floor((global.performance.now() - env0_16) / env0_15);
const processUptime = (importDefault(5256) /* metro dependency 5256: ProcessUtilsNative */).getProcessUptime();
if (processUptime != null) {
r0.uptime_process_renderer = global.Math.floor(processUptime);
}
const binding = env0_14;
const utmSource = binding.utmSource;
const utmMedium = binding.utmMedium;
const utmCampaign = binding.utmCampaign;
const utmContent = binding.utmContent;
r0.utm_source = r0.utm_source ?? utmSource;
r0.utm_medium = r0.utm_medium ?? utmMedium;
r0.utm_campaign = r0.utm_campaign ?? utmCampaign;
r0.utm_content = r0.utm_content ?? utmContent;
r0.launch_signature = env0_17;
env0_18.forEach(_fun8286);
return r0;
}
function debugLogEvent(a0, a1) { // fn#8287, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:790:7260, offset: 0x00d3ecef, size: 82 bytes, params: 3, frame: 16
let value = a2;
const r1 = value !== undefined ? value : false;
DeveloperOptionsStore.isLoggingAnalyticsEvents;
value = importAll(12) /* metro dependency 12: LogAggregator */;
const report = value.report;
if (r1) {
Reflect.apply(report, value, ['Analytics', a0, a1]);
} else {
Reflect.apply(report, value, ['Analytics', a0]);
}
}
function _fun8290({location_object_type}) { // fn#8290, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:790:748, offset: 0x00d3ed41, size: 58 bytes, params: 2, frame: 3
const ACK_MANUAL = AnalyticsObjectTypes.ACK_MANUAL;
return location_object_type === ACK_MANUAL ? undefined : {throttlePeriod: 900000, throttleKeys: function(a0) {
return [a0.guild_id, a0.channel_id, a0.location_section];
}};
}
function _fun8339({type}) { // fn#8339, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:790:4910, offset: 0x00d3f02c, size: 57 bytes, params: 2, frame: 3
const MEDIA_VIEWER = AnalyticsSections.MEDIA_VIEWER;
return type !== MEDIA_VIEWER ? undefined : {throttlePeriod: 60000, throttleKeys: function({type}) {
return [type];
}};
}
function track(a0, a1) { // fn#8351, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:790:7739, offset: 0x00d3f0c6, size: 223 bytes, params: 3, frame: 20
var isArray2;
var binding;
let value = a2;
const r6 = value !== undefined ? value : {};
const String = global.String;
value = String(a0);
if (env0_21) {
if (a1 != null) {
isArray2 = global.Array.isArray(env0_22[a0]);
binding = env0_22;
if (isArray2) {
binding[a0].push(a1);
} else {
binding[a0] = [a1];
}
}
}
if (r6.throttlePercent != null) {
var Math = global.Math;
if (Math.random() > r6.throttlePercent) {
return global.Promise.resolve();
}
}
const value4 = expandEventProperties(a1);
debugLogEvent(value, value4, r6.logEventProperties);
return env0_20(a0, value4, {flush: r6.flush, fingerprint: r6.fingerprint});
}
function addExtraAnalyticsDecorator(a0) { // fn#8352, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:790:8245, offset: 0x00d3f1a5, size: 24 bytes, params: 2, frame: 11
env0_18.push(a0);
}
function getAnalyticsEventsRecording() { // fn#8356, offset: 0x00d3f1e3, size: 9 bytes, params: 1, frame: 1
return env0_22;
}
function clearAnalyticsEventsRecording() { // fn#8357, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:790:8749, offset: 0x00d3f1ec, size: 46 bytes, params: 1, frame: 11
const Object = global.Object;
Object.keys(env0_22).forEach(_fun8358);
}
function isGameApplicationType(a0) { // fn#8359, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:790:8858, offset: 0x00d3f22c, size: 39 bytes, params: 2, frame: 4
const GAME = ApplicationTypes.GAME;
return a0 === GAME || a0 === ApplicationTypes.DEPRECATED_GAME;
}
function trackNetworkAction(a0, a1) { // fn#8360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:790:8955, offset: 0x00d3f253, size: 96 bytes, params: 3, frame: 17
const expandEventPropertiesBinding = expandEventProperties;
let object2 = {};
object2.location = getLocation();
copyDataProperties(object2, a1, undefined);
const value2 = expandEventPropertiesBinding(object2);
const setDebugTrackedDataBinding = setDebugTrackedData;
object2 = {type: 'action'};
copyDataProperties(object2, a1, 'action');
setDebugTrackedDataBinding(a0, object2);
debugLogEvent(a0, value2);
env0_23(a0, value2);
}
function getNewAnalyticsLoadId() { // fn#8361, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:790:9114, offset: 0x00d3f2b3, size: 37 bytes, params: 1, frame: 11
return (require(491) /* metro dependency 491 */).v4();
}
function _fun8358(a0) { // fn#8358, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:790:8814, offset: 0x00d3f21a, size: 18 bytes, params: 2, frame: 2
delete env1_22[a0];
}
+613
View File
@@ -0,0 +1,613 @@
/* Metro module 6873; source: utils/ApplicationAssetUtils.tsx; dependencies: [57, 5, 6874, 661, 44, 507, 694, 3, 1457, 2] */
function _fun54417(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#54417, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7051:6, offset: 0x01364d47, size: 530 bytes, params: 8, frame: 24
var object2;
const env0_0 = require;
const _arrayLikeToArray_54420 = 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 updateAssets = function() {
return _updateAssets.apply(this, arguments);
};
const closure = getAssetFromImageURL;
const closure2 = function() {
return _getAssets.apply(this, arguments);
};
const closure3 = function() {
return _fetchAssetIds.apply(this, arguments);
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importDefault(5) /* metro dependency 5 */;
const applicationAssetsStore = importDefault(6874) /* metro dependency 6874: ApplicationAssetsStore */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_6 = constantsModule.Endpoints;
const PlatformTypes = constantsModule.PlatformTypes;
const env0_8 = RegExp('https:\\/\\/static-cdn\\.jtvnw\\.net\\/previews-ttv\\/live_user_(.+)-\\{width\\}x\\{height\\}.jpg',
'');
const env0_9 = RegExp('https:\\/\\/i\\.ytimg\\.com\\/vi\\/([a-zA-Z0-9_-]+)\\/hqdefault_live\\.jpg', '');
object2 = {};
const SPOTIFY = PlatformTypes.SPOTIFY;
object2[SPOTIFY] = {deserialize: function(a0) {
return '' + 'https://i.scdn.co/image/' + (0, global.encodeURIComponent)(a0);
}, serialize: function(a0) {
return a0.split('https://i.scdn.co/image/')[1];
}};
const TWITCH = PlatformTypes.TWITCH;
object2[TWITCH] = {deserialize: function(a0, a1) {
return 'https://static-cdn.jtvnw.net/previews-ttv/live_user_' + (0,
global.encodeURIComponent)(a0) + '-' + a1[0] + 'x' + a1[1] + '.jpg';
}, serialize: serialize_54448};
const YOUTUBE = PlatformTypes.YOUTUBE;
object2[YOUTUBE] = {deserialize: function(a0) {
return 'https://i.ytimg.com/vi/' + (0, global.encodeURIComponent)(a0) + '/hqdefault_live.jpg';
}, serialize: serialize_54450};
object2['mp'] = {deserialize: deserialize_54451, serialize: function(a0) {
return a0;
}};
const Map = global.Map;
const map = new Map();
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/ApplicationAssetUtils.tsx');
exports.getAssetFromImageURL = closure;
exports.getAssetImage = getAssetImage;
exports.getAssets = closure2;
exports.fetchAssetIds = closure3;
exports.getAssetIds = function(a0, a1) {
var r2;
var items = [];
if (!updateUrlAssetIds(a1, items)) {
r2 = ApplicationAssetsStore.getApplicationAssets(a0)?.assets;
if (r2 != null) {
updateNonUrlAssetIds(a1, items, r2);
}
}
return items;
};
}
function _createForOfIteratorHelperLoose_54418(a0, a1) { // fn#54418, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7051:177, offset: 0x01364f59, 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 _fun54419;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_54420(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_54420(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_54420(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun54419;
}
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 _updateAssets() { // fn#54422, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7051:2264, offset: 0x013650cb, size: 48 bytes, params: 1, frame: 14
return env0_4(_fun54424).apply(this, arguments);
}
function getApplicationAssetsMap(a0) { // fn#54425, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7051:2568, offset: 0x013651b2, size: 95 bytes, params: 2, frame: 15
const applicationAssets = ApplicationAssetsStore.getApplicationAssets(a0);
return applicationAssets == null || global.Date.now() - applicationAssets.lastUpdated > 3600000 ? updateAssets(a0) : global.Promise.resolve(applicationAssets);
}
function getAssetFromImageURL(a0, a1) { // fn#54426, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7051:2750, offset: 0x01365211, size: 72 bytes, params: 3, frame: 16
var r0;
let value = env0_10[a0].serialize(a1);
if (value) {
value = value.toString();
value = '' + a0 + ':' + value;
r0 = value;
} else {
r0 = null;
}
return r0;
}
function _getAssets() { // fn#54428, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7051:2907, offset: 0x01365259, size: 48 bytes, params: 1, frame: 14
return env0_4(_fun54430).apply(this, arguments);
}
function _resolveExternalAssets() { // fn#54431, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7051:3059, offset: 0x013652ce, size: 48 bytes, params: 1, frame: 14
return env0_4(_fun54433).apply(this, arguments);
}
function updateUrlAssetIds(a0, a1) { // fn#54435, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7051:3469, offset: 0x0136540e, size: 156 bytes, params: 3, frame: 23
var r4;
var r5;
var r11;
var r1;
var property;
var binding;
let length = a0.filter(function(a0) {
var r0;
var value = undefined;
r0 = a0 == null ? value : a0.startsWith('http:');
r0 = !r0 ? a0 == null ? value : a0.startsWith('https:') : r0;
return r0;
}).length;
let value = 0;
if (length > value) {
length = a0.length;
if (value < length) {
r4 = value;
r5 = value;
while (true) {
property = a0[r4];
if (property != null) {
binding = env0_11;
value = binding.get(property);
if (value == null) {
r11 = r5;
break;
}
a1[r4] = getAssetFromImageURL('mp', value);
value = typeof r5 === 'bigint' ? r5 + 1n : +r5 + 1;
r11 = value;
break;
}
r11 = r5;
value = typeof r4 === 'bigint' ? r4 + 1n : +r4 + 1;
length = a0.length;
if (value < length) {
r4 = value;
r5 = r11;
continue;
}
r1 = r11;
break;
}
} else {
r1 = value;
}
} else {
r1 = value;
}
return r1 === a0.length;
}
function updateNonUrlAssetIds(a0, a1, a2, a3) { // fn#54437, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7051:3756, offset: 0x013654e9, size: 173 bytes, params: 5, frame: 26
var r2;
var r3;
var r1;
var r15;
var r13;
var r0;
var property;
var Object;
var prototype;
var hasOwnProperty;
var call;
var value3;
var value4;
var id;
var value5;
let length = a0.length;
const value = 0;
const value2 = false;
if (value < length) {
r2 = value;
r3 = value2;
reducibleLoop1: while (true) {
property = a0[r2];
reducibleJoin10: while (true) {
if (property == null) {
r13 = r3;
break reducibleJoin10;
}
if (a1[r2] != null) {
r13 = r3;
break reducibleJoin10;
}
Object = global.Object;
prototype = Object.prototype;
hasOwnProperty = prototype.hasOwnProperty;
call = hasOwnProperty.call;
value3 = Reflect.apply(call, hasOwnProperty, [a2, property]);
reducibleJoin5: while (true) {
if (value3) {
property = a2[property];
r1 = property;
break reducibleJoin5;
}
r1 = value3;
break reducibleJoin5;
}
if (!r1) {
if (a3 != null) {
value4 = true;
if (!(a3 <= value)) {
r15 = value4;
a1[r2] = r1.id;
r13 = r15;
break reducibleJoin10;
}
}
a1[r2] = null;
r13 = r3;
break reducibleJoin10;
}
r15 = r3;
id = r1.id;
a1[r2] = id;
r13 = r15;
break reducibleJoin10;
}
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
length = a0.length;
if (value5 < length) {
r2 = value5;
r3 = r13;
continue reducibleLoop1;
}
r0 = r13;
break reducibleLoop1;
}
} else {
r0 = value2;
}
return r0;
}
function _fetchAssetIds() { // fn#54439, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7051:4055, offset: 0x01365596, size: 48 bytes, params: 1, frame: 14
return env0_4(_fun54441).apply(this, arguments);
}
function serialize_54448(a0) { // fn#54448, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7051:1551, offset: 0x01365842, size: 39 bytes, params: 2, frame: 11
const value = a0.match(env0_8);
const value2 = null;
return value2 != value ? value[1] : value2;
}
function serialize_54450(a0) { // fn#54450, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7051:1714, offset: 0x0136589a, size: 39 bytes, params: 2, frame: 11
const value = a0.match(env0_9);
const value2 = null;
return value2 != value ? value[1] : value2;
}
function deserialize_54451(a0) { // fn#54451, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7051:1779, offset: 0x013658c1, size: 300 bytes, params: 2, frame: 17
let value = importDefault(44) /* metro dependency 44 */;
let GLOBAL_ENV = global.window.GLOBAL_ENV;
let MEDIA_PROXY_ENDPOINT = GLOBAL_ENV.MEDIA_PROXY_ENDPOINT;
value(MEDIA_PROXY_ENDPOINT != null, 'MEDIA_PROXY_ENDPOINT not configured');
const URL = global.URL;
const protocol = global.location.protocol;
GLOBAL_ENV = global.window.GLOBAL_ENV;
MEDIA_PROXY_ENDPOINT = GLOBAL_ENV.MEDIA_PROXY_ENDPOINT;
value = protocol + MEDIA_PROXY_ENDPOINT;
const uRL = new URL(a0);
const value4 = a0.toLowerCase().endsWith('.gif');
const value6 = a0.toLowerCase().endsWith('.webp');
const value8 = a0.toLowerCase().endsWith('.avif');
if (value4 || value8) {
uRL.searchParams.set('format', 'webp');
}
let r0 = value4 || value6;
r0 = !r0 ? value8 : r0;
if (r0) {
uRL.searchParams.set('animated', 'true');
}
return uRL.toString();
}
function getAssetImage(a0, a1, a2) { // fn#54453, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7051:4964, offset: 0x013659ed, size: 610 bytes, params: 4, frame: 34
var r8;
var r13;
var r0;
var r1;
var Array;
var Math;
var max;
var items2;
var value12;
var property;
var property2;
var hasOwnProperty;
let value = a2;
const value2 = a3;
const value3 = undefined;
const r15 = value2 !== value3 ? value2 : 'png';
if (a1 != null) {
if (a1.includes(':')) {
value12 = env0_3(a1.split(':'), 2);
property = value12[0];
property2 = value12[1];
if (property === PlatformTypes.TWITCH) {
if (value == null) {
value = importDefault(3) /* metro dependency 3: Logger */;
value = new value('ApplicationAssetUtils');
value.warn('getAssetImage: size must === [number, number] for Twitch');
r1 = value3;
} else if (typeof value === 'number') {
value = importDefault(3) /* metro dependency 3: Logger */;
value = new value('ApplicationAssetUtils');
value.warn('getAssetImage: size must === [number, number] for Twitch');
r1 = value3;
} else {
value = env0_10[PlatformTypes.TWITCH].deserialize(property2, value);
r1 = value;
}
r0 = r1;
} else {
hasOwnProperty = global.Object.prototype.hasOwnProperty;
r0 = hasOwnProperty.call(env0_10, property) ? env0_10[property].deserialize(property2) : value3;
}
return r0;
}
}
if (a0 != null) {
if (a1 != null) {
Array = global.Array;
if (Array.isArray(value)) {
Math = global.Math;
max = Math.max;
items2 = [];
arraySpread(items2, value, 0, undefined);
value = apply(max, items2, Math, undefined);
r8 = value;
} else {
r8 = value;
}
value = '';
r13 = typeof r8 !== 'number' ? value : '?size=' + (require(1457) /* metro dependency 1457: ImageLoaderUtils */).getBestMediaProxySize(r8);
if (global.window.GLOBAL_ENV.CDN_HOST != null) {
value = value + global.location.protocol + '//' + global.window.GLOBAL_ENV.CDN_HOST + '/app-assets/' + a0 + '/' + a1 + '.' + r15 + r13;
r0 = value;
} else {
value = value + (require(507) /* metro dependency 507: HTTPUtils */).getAPIBaseURL() + '/applications/' + a0 + '/app-assets/' + a1 + '.' + r15 + r13;
r0 = value;
}
return r0;
}
}
return value3;
}
function* _fun54424(a0) { // fn#54424, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7051:2313, offset: 0x01365104, size: 174 bytes, params: 2, frame: 17
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
const HTTP = env2_0(env2_2[5]).HTTP;
const get = HTTP.get;
const object2 = {'url': null, 'oldFormErrors': true, 'rejectWithError': false};
object2.url = env2_6.APPLICATION_ASSETS(a0);
yield Reflect.apply(get, HTTP, [object2]);
const value3 = undefined;
if (false) {
return value3;
}
const body = value3.body;
const value5 = env2_1(env2_2[6]);
value5.dispatch({type: 'APPLICATION_ASSETS_UPDATE', applicationId: a0, assets: body});
return env2_5.getApplicationAssets(a0);
}
function* _fun54430(a0) { // fn#54430, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7051:2950, offset: 0x01365292, size: 60 bytes, params: 2, frame: 12
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
value = undefined;
yield env2_16(a0);
const value3 = undefined;
if (false) {
return value3;
}
return value3 == null ? value : value3.assets;
}
function* _fun54433(a0, a1) { // fn#54433, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7051:3126, offset: 0x01365307, size: 228 bytes, params: 3, frame: 20
var environment;
var r3;
var value3;
var binding;
var HTTP;
var post;
var object2;
var value5;
var done;
var value6;
var url;
var external_asset_path;
var set;
var value7;
if (true) {
if (a1.filter(_fun54434).length !== 0) {
value3 = environment.__proto__.__proto__;
binding = env2_12;
HTTP = env2_0(env2_2[5]).HTTP;
post = HTTP.post;
object2 = {};
object2.url = env2_6.APPLICATION_EXTERNAL_ASSETS(a0);
object2.body = {urls: value};
object2.oldFormErrors = true;
object2.rejectWithError = false;
yield Reflect.apply(post, HTTP, [object2]);
value = undefined;
if (false) {
return value;
}
value = binding(value.body);
value5 = value();
done = value5.done;
if (!done) {
r3 = value5;
reducibleLoop5: while (true) {
value6 = r3.value;
url = value6.url;
external_asset_path = value6.external_asset_path;
binding = env2_11;
set = binding.set;
Reflect.apply(set, binding, [url, external_asset_path]);
value7 = value();
done = value7.done;
if (done) {
break reducibleLoop5;
}
r3 = value7;
continue reducibleLoop5;
}
}
}
}
}
async function _fun54441(a0, a1) { // fn#54441, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7051:4106, offset: 0x013655d8, size: 402 bytes, params: 3, frame: 27
var environment;
var r9;
let value = a2;
if (false) {
return undefined;
}
const env0_0 = a0;
const env0_1 = a1;
const r11 = value !== undefined ? value : 1;
await undefined;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
env2_1(env2_2[6]).dispatch({type: 'APPLICATION_ASSETS_FETCH', applicationId: a0});
items = [];
const value6 = a1.filter(function(a0) {
var r0;
var value = undefined;
r0 = a0 == null ? value : a0.startsWith('http:');
r0 = !r0 ? a0 == null ? value : a0.startsWith('https:') : r0;
return r0;
});
if (value6.length > 0) {
await resolveExternalAssets(a0, value6);
if (false) {
return undefined;
}
}
if (env2_21(a1, items)) {
env2_1(env2_2[6]).dispatch({type: 'APPLICATION_ASSETS_FETCH_SUCCESS', applicationId: a0});
return items;
}
await env2_18(a0);
const value9 = undefined;
if (false) {
return value9;
}
const value11 = env2_1(env2_2[6]);
value11.dispatch({type: 'APPLICATION_ASSETS_UPDATE', applicationId: a0, assets: value9});
if (env2_22(a1, items, value9, r11)) {
value = env2_14(a0);
value = value.then(_fun54444);
r9 = value;
} else {
env2_1(env2_2[6]).dispatch({type: 'APPLICATION_ASSETS_FETCH_SUCCESS', applicationId: a0});
r9 = items;
}
return r9;
}
function _fun54434(a0) { // fn#54434, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7051:3157, offset: 0x013653eb, size: 35 bytes, params: 2, frame: 13
var r0;
var binding;
let value = a0 != null;
if (value) {
value = environment.__proto__.__proto__.__proto__;
binding = env3_11;
value = binding.get(a0) == null;
r0 = value;
} else {
r0 = value;
}
return r0;
}
function resolveExternalAssets() { // fn#54443, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7051:4322, offset: 0x0136576a, size: 30 bytes, params: 1, frame: 13
return env3_20.apply(this, arguments);
}
function _fun54444() { // fn#54444, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7051:4686, offset: 0x01365788, size: 40 bytes, params: 1, frame: 15
return env3_23(env0_0, require, env0_2 - 1);
}
+392
View File
@@ -0,0 +1,392 @@
/* Metro module 4659; source: utils/AttachmentFile.native.tsx; dependencies: [5, 3, 44, 4650, 4660, 4651, 2] */
function _fun40259(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#40259, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4837:6, offset: 0x010fac82, size: 198 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
let value = importDefault(3) /* metro dependency 3: Logger */;
value = new value('AttachmentFile');
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/AttachmentFile.native.tsx');
exports.getAttachmentFile = function() {
return _getAttachmentFile.apply(this, arguments);
};
exports.cancelGetAttachmentFile = function() {
return _cancelGetAttachmentFile.apply(this, arguments);
};
exports.fileIsInAppDir = fileIsInAppDir;
}
function _getAttachmentFile() { // fn#40260, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4837:141, offset: 0x010fad48, size: 48 bytes, params: 1, frame: 14
return env0_3(_fun40262).apply(this, arguments);
}
function _cancelGetAttachmentFile() { // fn#40263, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4837:617, offset: 0x010faedd, size: 48 bytes, params: 1, frame: 14
return env0_3(_fun40265).apply(this, arguments);
}
function fileIsInAppDir(a0) { // fn#40268, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4837:1061, offset: 0x010faf57, size: 153 bytes, params: 2, frame: 17
var r0;
var value2;
var property;
var moduleValue;
var appDir;
var value4;
var startsWith;
var moduleValue2;
var appDir2;
var error;
var binding;
let value = a0.replace(RegExp('^file:\\/\\/', ''), '');
try {
value2 = environment;
property = dependencyMap[4];
moduleValue = require(property);
appDir = moduleValue.getAppDir();
value4 = appDir !== '';
if (value4) {
startsWith = value.startsWith;
property = dependencyMap[4];
moduleValue2 = require(property);
appDir2 = moduleValue2.getAppDir();
value = Reflect.apply(startsWith, value, [appDir2]);
r0 = value;
} else {
r0 = value4;
}
} catch (error) {
binding = env0_4;
binding.error('Failed to get app dir', error);
return false;
}
return r0;
}
function* _fun40262(a0, a1) { // fn#40262, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4837:200, offset: 0x010fad81, size: 348 bytes, params: 3, frame: 24
var r4;
var r5;
var value;
var value2;
var value3;
var binding;
var binding2;
var value4;
var item;
var platform;
var UploadPlatform;
var REACT_NATIVE;
var binding3;
var property;
var value5;
var getFileInfo;
var value6;
var value7;
var value8;
var binding4;
var value9;
var getAttachmentPayload;
var name;
var value10;
var binding5;
var value11;
var getFileSize;
var uri;
var value12;
var value13;
var value14;
var error;
var object2;
var filename;
var value15;
var value16;
exceptionLanding51: while (true) {
value = undefined;
value2 = false;
if (value2) {
return value;
}
value = undefined;
value3 = environment.__proto__.__proto__;
binding = env2_1;
binding2 = env2_2;
value4 = binding(binding2[2]);
item = a0.item;
platform = item.platform;
binding = env2_0;
UploadPlatform = binding(binding2[3]).UploadPlatform;
REACT_NATIVE = UploadPlatform.REACT_NATIVE;
value4(platform === REACT_NATIVE, 'Upload must be in the React Native format');
try {
binding = env2_0;
} catch (error) {
break exceptionLanding51;
}
try {
binding3 = env2_2;
} catch (error) {
break exceptionLanding51;
}
try {
property = binding3[4];
} catch (error) {
break exceptionLanding51;
}
try {
value5 = binding(property);
} catch (error) {
break exceptionLanding51;
}
try {
getFileInfo = value5.getFileInfo;
} catch (error) {
break exceptionLanding51;
}
try {
value6 = Reflect.apply(getFileInfo, value5, [a0, a1]);
} catch (error) {
break exceptionLanding51;
}
yield value6;
try {
value7 = undefined;
value8 = false;
} catch (error) {
break exceptionLanding51;
}
if (value8) {
return value7;
}
try {
binding = env2_0;
} catch (error) {
break exceptionLanding51;
}
try {
binding4 = env2_2;
} catch (error) {
break exceptionLanding51;
}
try {
property = binding4[5];
} catch (error) {
break exceptionLanding51;
}
try {
value9 = binding(property);
} catch (error) {
break exceptionLanding51;
}
try {
getAttachmentPayload = value9.getAttachmentPayload;
} catch (error) {
break exceptionLanding51;
}
try {
name = value7.name;
} catch (error) {
break exceptionLanding51;
}
try {
value10 = Reflect.apply(getAttachmentPayload, value9, [a0, a1, name]);
} catch (error) {
break exceptionLanding51;
}
reducibleJoin24: while (true) {
reduciblePort38: while (true) {
exceptionLanding37: while (true) {
try {
try {
binding = env2_0;
} catch (error) {
break exceptionLanding37;
}
} catch (error) {
break exceptionLanding51;
}
break reducibleJoin24;
}
r4 = value;
break reduciblePort38;
}
try {
object2 = {};
} catch (error) {
break exceptionLanding51;
}
try {
object2.file = value7;
} catch (error) {
break exceptionLanding51;
}
try {
uri = value7.uri;
} catch (error) {
break exceptionLanding51;
}
try {
object2.uri = uri;
} catch (error) {
break exceptionLanding51;
}
try {
filename = value10.filename;
} catch (error) {
break exceptionLanding51;
}
try {
value15 = filename != null;
} catch (error) {
break exceptionLanding51;
}
value16 = '';
reducibleJoin47: while (true) {
if (value15) {
r5 = filename;
break reducibleJoin47;
}
r5 = value16;
break reducibleJoin47;
}
try {
object2.name = r5;
} catch (error) {
break exceptionLanding51;
}
try {
object2.fileSize = r4;
} catch (error) {
break exceptionLanding51;
}
return object2;
}
try {
try {
binding5 = env2_2;
} catch (error) {
break exceptionLanding37;
}
} catch (error) {
break exceptionLanding51;
}
try {
try {
property = binding5[4];
} catch (error) {
break exceptionLanding37;
}
} catch (error) {
break exceptionLanding51;
}
try {
try {
value11 = binding(property);
} catch (error) {
break exceptionLanding37;
}
} catch (error) {
break exceptionLanding51;
}
try {
try {
getFileSize = value11.getFileSize;
} catch (error) {
break exceptionLanding37;
}
} catch (error) {
break exceptionLanding51;
}
try {
try {
uri = value7.uri;
} catch (error) {
break exceptionLanding37;
}
} catch (error) {
break exceptionLanding51;
}
try {
try {
value12 = Reflect.apply(getFileSize, value11, [uri]);
} catch (error) {
break exceptionLanding37;
}
} catch (error) {
break exceptionLanding51;
}
yield value12;
try {
try {
value13 = undefined;
value14 = false;
} catch (error) {
break exceptionLanding37;
}
} catch (error) {
break exceptionLanding51;
}
if (value14) {
return value13;
}
r4 = value13;
try {
object2 = {};
} catch (error) {
break exceptionLanding51;
}
try {
object2.file = value7;
} catch (error) {
break exceptionLanding51;
}
try {
uri = value7.uri;
} catch (error) {
break exceptionLanding51;
}
try {
object2.uri = uri;
} catch (error) {
break exceptionLanding51;
}
try {
filename = value10.filename;
} catch (error) {
break exceptionLanding51;
}
try {
value15 = filename != null;
} catch (error) {
break exceptionLanding51;
}
value16 = '';
reducibleJoin47: while (true) {
if (value15) {
r5 = filename;
break reducibleJoin47;
}
r5 = value16;
break reducibleJoin47;
}
try {
object2.name = r5;
} catch (error) {
break exceptionLanding51;
}
try {
object2.fileSize = r4;
} catch (error) {
break exceptionLanding51;
}
return object2;
}
env2_4.error('Failed to get attachment file', error);
return value;
}
function* _fun40265(a0) { // fn#40265, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4837:688, offset: 0x010faf16, size: 65 bytes, params: 2, frame: 13
if (true) {
value = environment.__proto__.__proto__;
value = env2_0(env2_2[4]);
yield value.cancelGetFileInfo(a0);
}
}
+33
View File
@@ -0,0 +1,33 @@
/* Metro module 1355; source: utils/AuthenticationUtils.tsx; dependencies: [692, 1356, 2] */
function _fun15565(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#15565, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1482:6, offset: 0x00e36297, size: 129 bytes, params: 8, frame: 19
const env0_0 = require;
const closure = getToken_15566;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/AuthenticationUtils.tsx');
exports.getToken = closure;
exports.isAuthenticated = isAuthenticated;
exports.getArtForPath = getArtForPath;
}
function getToken_15566() { // fn#15566, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1482:43, offset: 0x00e36318, size: 36 bytes, params: 1, frame: 11
return (importAll(692) /* metro dependency 692: TokenManager */).getToken();
}
function isAuthenticated() { // fn#15567, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1482:239, offset: 0x00e3633c, size: 21 bytes, params: 1, frame: 9
return getToken_15566() != null;
}
function getArtForPath(a0) { // fn#15568, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1482:307, offset: 0x00e36351, size: 70 bytes, params: 2, frame: 13
var r0;
var regexp;
const value = null;
if (value != a0) {
regexp = RegExp('^\\/developers', '');
r0 = regexp.test(a0) ? require(1356) /* metro dependency 1356 */ : value;
} else {
r0 = value;
}
return r0;
}
File diff suppressed because it is too large. Load diff
+915
View File
@@ -0,0 +1,915 @@
/* Metro module 1423; source: utils/AvatarUtils.tsx; dependencies: [661, 1424, 1426, 477, 1457, 1468, 1853, 1856, 24, 1857, 1859, 1860, 21, 1473, 2] */
function _fun16603(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#16603, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:6, offset: 0x00e54bbf, size: 1034 bytes, params: 8, frame: 50
var object2;
const env0_0 = require;
const closure = getEmojiURL;
const closure2 = getDefaultAvatarURL;
const closure3 = getUserAvatarURL;
const closure4 = getGuildMemberAvatarURLSimple;
const closure5 = getGuildMemberAvatarURL;
const closure6 = getGuildMemberAvatarSource;
const closure7 = getUserBannerURL;
const closure8 = getAvatarDecorationURL;
const closure9 = getGuildMemberBannerURL;
const closure10 = getGuildSplashURL;
const closure11 = getGuildBannerURL;
const closure12 = getGuildHomeHeaderURL;
const closure13 = getResourceChannelIconURL;
const closure14 = getNewMemberActionIconURL;
const closure15 = getGuildDiscoverySplashURL;
const closure16 = getGuildIconURL_16621;
const closure17 = getGuildTemplateIconURL;
const closure18 = getApplicationIconURL;
const closure19 = getGameAssetURL;
const closure20 = getVideoFilterAssetURL;
const closure21 = getChannelIconURL;
const closure22 = hasAnimatedGuildIcon;
const closure23 = function(a0) {
return a0 != null && a0.startsWith('a_');
};
const closure24 = function(a0) {
return a0 != null && a0.startsWith('v_');
};
const closure25 = function(a0) {
var value = a0;
return typeof value === 'number' ? value : {uri: value ?? undefined};
};
const closure26 = isDataUri;
const getAnimatedFormat = function(a0) {
return a0 ? 'webp' : 'gif';
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = 0;
const value2 = require(dependencyMap[value]);
const env0_3 = value2.Endpoints;
const env0_4 = value2.AVATAR_SIZE;
const env0_5 = (require(1424) /* metro dependency 1424: AvatarDecorationConstants */).AVATAR_DECORATION_SIZE;
const regexp = RegExp('^data:', '');
const DEFAULT_AVATARS = (require(1426) /* metro dependency 1426: AvatarUtils */).default.DEFAULT_AVATARS;
const DEFAULT_AVATARS_SMALL = (require(1426) /* metro dependency 1426: AvatarUtils */).default.DEFAULT_AVATARS_SMALL;
const r25 = DEFAULT_AVATARS_SMALL ?? DEFAULT_AVATARS;
const DEFAULT_AVATARS_SMALL_MAX_SIZE = (require(1426) /* metro dependency 1426: AvatarUtils */).default.DEFAULT_AVATARS_SMALL_MAX_SIZE;
const r24 = DEFAULT_AVATARS_SMALL_MAX_SIZE ?? value;
const DEFAULT_PROVISIONAL_AVATARS = (require(1426) /* metro dependency 1426: AvatarUtils */).default.DEFAULT_PROVISIONAL_AVATARS;
const DEFAULT_GROUP_DM_AVATARS = (require(1426) /* metro dependency 1426: AvatarUtils */).default.DEFAULT_GROUP_DM_AVATARS;
value = (require(1426) /* metro dependency 1426: AvatarUtils */).default.canUseWebp();
const env0_12 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid();
object2 = {getUserAvatarURL: closure3, getDefaultAvatarURL: closure2, getGuildMemberAvatarURL: closure5,
getGuildMemberAvatarURLSimple: closure4, getGuildMemberAvatarSource: closure6,
getGuildMemberBannerURL: closure9, getUserBannerURL: closure7, getAvatarDecorationURL: closure8,
hasAnimatedGuildIcon: closure22, isAnimatedIconHash: closure23, getUserAvatarSource: function(a0, a1, a2) {
return makeSource(getUserAvatarURL(a0, a1, a2));
}, getGuildIconURL: closure16, getGuildSplashURL: closure10, getGuildSplashSource: function(a0) {
return makeSource(getGuildSplashURL(a0));
}, getGuildDiscoverySplashURL: closure15, getGuildDiscoverySplashSource: function(a0) {
return makeSource(getGuildDiscoverySplashURL(a0));
}, getGuildBannerURL: closure11, getGuildHomeHeaderURL: closure12, getResourceChannelIconURL: closure13,
getNewMemberActionIconURL: closure14, getGuildTemplateIconURL: closure17, getChannelIconURL: closure21,
getEmojiURL: closure, getApplicationIconURL: closure18, getGameAssetURL: closure19,
getVideoFilterAssetURL: closure20, getGameAssetSource: function(a0) {
return makeSource(getGameAssetURL(a0));
}, getGuildIconSource: function(a0) {
return makeSource(getGuildIconURL_16621(a0));
}, getGuildTemplateIconSource: function(a0) {
return makeSource(getGuildTemplateIconURL(a0));
}, getGuildBannerSource: getGuildBannerSource, getGuildHomeHeaderSource: function(a0) {
return makeSource(getGuildHomeHeaderURL(a0));
}, getChannelIconSource: function(a0) {
return makeSource(getChannelIconURL(a0));
}, getApplicationIconSource: function(a0) {
return makeSource(getApplicationIconURL(a0));
}, makeSource: closure25, getAnimatableSourceWithFallback: getAnimatableSourceWithFallback};
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/AvatarUtils.tsx');
exports.default = object2;
exports.DATA_IMAGE_PREFIX = regexp;
exports.DEFAULT_AVATARS = DEFAULT_AVATARS;
exports.DEFAULT_AVATARS_SMALL = r25;
exports.DEFAULT_AVATARS_SMALL_MAX_SIZE = r24;
exports.DEFAULT_PROVISIONAL_AVATARS = DEFAULT_PROVISIONAL_AVATARS;
exports.DEFAULT_GROUP_DM_AVATARS = DEFAULT_GROUP_DM_AVATARS;
exports.SUPPORTS_WEBP = value;
exports.LEGACY_DEFAULT_AVATAR_COUNT = 5;
exports.DEFAULT_AVATAR_COUNT = 6;
exports.getEmojiURL = closure;
exports.getDefaultAvatarURL = closure2;
exports.getUserAvatarURL = closure3;
exports.getGuildMemberAvatarURLSimple = closure4;
exports.getGuildMemberAvatarURL = closure5;
exports.getGuildMemberAvatarSource = closure6;
exports.getUserBannerURL = closure7;
exports.getAvatarDecorationURL = closure8;
exports.getGuildMemberBannerURL = closure9;
exports.getResourceChannelIconURL = closure13;
exports.getNewMemberActionIconURL = closure14;
exports.getGuildTemplateIconURL = closure17;
exports.getVideoFilterAssetURL = closure20;
exports.hasAnimatedGuildIcon = closure22;
exports.isAnimatedIconHash = closure23;
exports.isVideoAssetHash = closure24;
exports.isAnimatedImageURL = isAnimatedImageURL;
exports.isVideoURL = isVideoURL;
exports.makeSource = closure25;
exports.isDataUri = closure26;
}
function getAvatarURL({endpoint, path, id, hash, size, lossless, canAnimate, keepAspectRatio, format, canWebP}) { // fn#16604, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:483, offset: 0x00e54fc9, size: 547 bytes, params: 2, frame: 34
var r12;
var r4;
var r0;
var r7;
var r2;
var value;
var CDN_HOST;
var object2;
var getBestMediaProxySize;
var moduleValue;
lossless = !(lossless === undefined) && lossless;
canAnimate = !(canAnimate === undefined) && canAnimate;
format = format === undefined ? null : format;
const r11 = canWebP !== undefined ? canWebP : env0_11;
if (id != null) {
if (hash != null) {
r12 = format ?? (canAnimate && isAnimatedIconHash(hash) ? getAnimatedFormat(r11) : 'jpg');
r12 = canAnimate && isVideoAssetHash(hash) ? 'mp4' : r12;
CDN_HOST = global.window.GLOBAL_ENV.CDN_HOST;
if (CDN_HOST != null) {
r4 = r12 !== 'jpg' ? r12 : r11 ? 'webp' : 'png';
r0 = 'https://' + CDN_HOST + '/' + path + '/' + id + '/' + hash + '.' + r4;
r7 = r4;
} else {
value = global.location.protocol + global.window.GLOBAL_ENV.API_ENDPOINT;
value += endpoint(id, hash, r12);
r0 = value;
r7 = r12;
}
if (r7 === 'mp4') {
return r0;
}
object2 = {};
if (size != null) {
value = require(1457) /* metro dependency 1457: ImageLoaderUtils */;
getBestMediaProxySize = value.getBestMediaProxySize;
moduleValue = require(1457) /* metro dependency 1457: ImageLoaderUtils */;
object2.size = Reflect.apply(getBestMediaProxySize, value, [size * moduleValue.getDevicePixelRatio()]);
}
if (keepAspectRatio != null) {
object2.keep_aspect_ratio = keepAspectRatio;
}
if (lossless) {
object2.quality = 'lossless';
}
value = r7 === 'webp';
r2 = value && canAnimate;
r2 = r2 && isAnimatedIconHash(hash);
if (r2) {
object2.animated = true;
}
value = importDefault(1468) /* metro dependency 1468 */;
value = value.stringify(object2);
return r0 + ('?' + value);
}
}
}
function getEmojiURL({id, animated, size, forcePNG}) { // fn#16605, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:1176, offset: 0x00e551ec, size: 492 bytes, params: 2, frame: 34
var enabled;
var property;
var moduleValue3;
var getForceSdrEmojisStickersConfig;
var forceSdrEmojisStickersConfig;
var error;
forcePNG = !(forcePNG === undefined) && forcePNG;
let value = 'png';
const r0 = forcePNG ? value : animated ? env0_11 ? 'webp' : 'gif' : env0_11 ? 'webp' : value;
const value3 = '';
const r02 = env0_11 && animated ? '&animated=true' : value3;
const moduleValue = require(dependencyMap[4]);
const getBestMediaProxySize = moduleValue.getBestMediaProxySize;
const moduleValue2 = require(dependencyMap[4]);
const getDevicePixelRatio = moduleValue2.getDevicePixelRatio;
const value7 = 'size=' + Reflect.apply(getBestMediaProxySize, moduleValue,
[size * Reflect.apply(getDevicePixelRatio, moduleValue2, []), env0_12]);
try {
property = dependencyMap[6];
moduleValue3 = require(property);
getForceSdrEmojisStickersConfig = moduleValue3.getForceSdrEmojisStickersConfig;
forceSdrEmojisStickersConfig = getForceSdrEmojisStickersConfig({location: 'getEmojiURL'});
enabled = forceSdrEmojisStickersConfig.enabled;
} catch (error) {
enabled = false;
}
const r9 = enabled ? '&force_sdr=true' : value3;
let GLOBAL_ENV = global.window.GLOBAL_ENV;
const CDN_HOST = GLOBAL_ENV.CDN_HOST;
if (CDN_HOST != null) {
return value3 + global.location.protocol + '//' + global.window.GLOBAL_ENV.CDN_HOST + '/emojis/' + id + '.' + r0 + '?' + value7 + r02 + r9;
}
const protocol = global.location.protocol;
GLOBAL_ENV = global.window.GLOBAL_ENV;
const API_ENDPOINT = GLOBAL_ENV.API_ENDPOINT;
const value11 = protocol + API_ENDPOINT;
const EMOJI = Endpoints.EMOJI;
value = value11 + Reflect.apply(EMOJI, Endpoints, [id, r0]);
return enabled ? value3 + value + '?force_sdr=true' : value;
}
function getDefaultAvatarURL(a0, a1) { // fn#16606, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:1742, offset: 0x00e553d8, size: 221 bytes, params: 3, frame: 18
let value = a2;
let r0 = value !== undefined ? value : false;
const r1 = r0 ? DEFAULT_PROVISIONAL_AVATARS : r0 || a3 == null ? DEFAULT_AVATARS : a3 <= env0_9 ? env0_8 : DEFAULT_AVATARS;
if (a0 == null) {
if (a1 == null) {
return r1[0];
}
}
const integer = (require(1856) /* metro dependency 1856: NumberUtils */).parseInteger(a1, 0);
if (integer > 0) {
r0 = r1[integer % 5];
} else if (a0 != null) {
value = (importDefault(24) /* metro dependency 24 */)(a0);
value = value.shiftRight(22);
value = value.mod(r1.length);
r0 = r1[value.toJSNumber()];
} else {
r0 = r1[0];
}
return r0;
}
function getUserAvatarURLWithoutFallback({id, avatar, discriminator, bot}) { // fn#16607, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:1966, offset: 0x00e554b5, size: 214 bytes, params: 2, frame: 20
var property;
const value = a1;
const value2 = a2;
const value3 = a3;
const value4 = a4;
const r7 = value !== undefined ? value : false;
const r8 = value2 !== undefined ? value2 : AVATAR_SIZE;
const r6 = value3 !== undefined ? value3 : null;
const r5 = value4 !== undefined ? value4 : env0_11;
if (bot) {
property = (require(1426) /* metro dependency 1426: AvatarUtils */).default.BOT_AVATARS[avatar];
if (property) {
return property;
}
if (avatar != null) {
return getAvatarURL({endpoint: Endpoints.AVATAR, path: 'avatars', id: id, hash: avatar, size: r8,
canAnimate: r7,
format: r6, canWebP: r5});
}
if (discriminator === '0000') {
return DEFAULT_AVATARS[0];
}
return getAvatarURL({endpoint: Endpoints.AVATAR, path: 'avatars', id: id, hash: avatar, size: r8,
canAnimate: r7,
format: r6, canWebP: r5});
}
const getAvatarURLBinding = getAvatarURL;
const AVATAR = Endpoints.AVATAR;
return getAvatarURLBinding({endpoint: AVATAR, path: 'avatars', id: id, hash: avatar, size: r8, canAnimate: r7,
format: r6, canWebP: r5});
}
function getUserAvatarURL(a0) { // fn#16608, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:2265, offset: 0x00e5558b, size: 117 bytes, params: 2, frame: 20
const value = a1;
const value2 = a2;
const value3 = a3;
const value4 = a4;
const r7 = value !== undefined ? value : false;
const r6 = value2 !== undefined ? value2 : AVATAR_SIZE;
return getUserAvatarURLWithoutFallback(a0, r7, r6, value3 !== undefined ? value3 : null,
value4 !== undefined ? value4 : env0_11) ?? getDefaultAvatarURL(a0.id, a0.discriminator, a0.isProvisional, r6);
}
function getGuildMemberAvatarURLSimple({guildId, userId, avatar, canAnimate, size, canWebP}) { // fn#16609, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:2442, offset: 0x00e55600, size: 448 bytes, params: 2, frame: 25
var r2;
var r1;
var r8;
var value;
canAnimate = !(canAnimate === undefined) && canAnimate;
const r11 = size !== undefined ? size : AVATAR_SIZE;
const r4 = canWebP !== undefined ? canWebP : env0_11;
const r3 = canAnimate && isAnimatedIconHash(avatar) ? getAnimatedFormat(r4) : 'jpg';
const GLOBAL_ENV = global.window.GLOBAL_ENV;
const CDN_HOST = GLOBAL_ENV.CDN_HOST;
if (CDN_HOST != null) {
r2 = value !== r3 ? r3 : r4 ? 'webp' : 'png';
value = Endpoints.GUILD_MEMBER_AVATAR(guildId, userId, avatar, r2);
value = 'https://' + CDN_HOST + value;
r1 = value;
r8 = r2;
} else {
value = global.location.protocol + global.window.GLOBAL_ENV.API_ENDPOINT;
value += Endpoints.GUILD_MEMBER_AVATAR(guildId, userId, avatar, r3);
r1 = value;
r8 = r3;
}
const object2 = {};
const imageLoaderUtilsModule = require(1457) /* metro dependency 1457: ImageLoaderUtils */;
const getBestMediaProxySize = imageLoaderUtilsModule.getBestMediaProxySize;
const moduleValue2 = imageLoaderUtilsModule;
const getDevicePixelRatio = moduleValue2.getDevicePixelRatio;
object2.size = Reflect.apply(getBestMediaProxySize, imageLoaderUtilsModule,
[r11 * Reflect.apply(getDevicePixelRatio, moduleValue2, [])]);
if (r8 === 'webp' && canAnimate && isAnimatedIconHash(avatar)) {
object2.animated = true;
}
value = importDefault(1468) /* metro dependency 1468 */;
value = value.stringify(object2);
return r1 + ('?' + value);
}
function getGuildMemberAvatarURL({userId, avatar, guildId}) { // fn#16610, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:2976, offset: 0x00e557c0, size: 73 bytes, params: 2, frame: 16
let value = a1;
const r4 = value !== undefined ? value : false;
value = null;
return value == avatar ? value : getGuildMemberAvatarURLSimple({userId: userId, avatar: avatar, guildId: guildId,
canAnimate: r4});
}
function getGuildMemberAvatarSource(a0, a1) { // fn#16611, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:3139, offset: 0x00e55809, size: 66 bytes, params: 3, frame: 16
const value = a2;
const r5 = value !== undefined ? value : false;
const guildMemberAvatarURL = getGuildMemberAvatarURL(a0, r5);
return guildMemberAvatarURL != null ? makeSource(guildMemberAvatarURL) : a1.getAvatarSource(a0.guildId, r5);
}
function getUserBannerURL({id, banner, canAnimate, size}) { // fn#16612, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:3280, offset: 0x00e5584b, size: 372 bytes, params: 2, frame: 28
var r8;
var r1;
var r3;
var CDN_HOST;
var value;
var object2;
var moduleValue;
var getBestMediaProxySize;
var moduleValue2;
if (banner != null) {
CDN_HOST = global.window.GLOBAL_ENV.CDN_HOST;
value = 'png';
r8 = canAnimate && isAnimatedIconHash(banner) ? getAnimatedFormat(env0_11) : value;
if (CDN_HOST != null) {
r1 = 'https://' + CDN_HOST + '/banners/' + id + '/' + banner + '.' + r8;
} else {
value = global.location.protocol + global.window.GLOBAL_ENV.API_ENDPOINT;
value += Endpoints.USER_BANNER(id, banner, r8);
r1 = value;
}
object2 = {};
moduleValue = require(1457) /* metro dependency 1457: ImageLoaderUtils */;
getBestMediaProxySize = moduleValue.getBestMediaProxySize;
moduleValue2 = require(1457) /* metro dependency 1457: ImageLoaderUtils */;
object2.size = Reflect.apply(getBestMediaProxySize, moduleValue, [size * moduleValue2.getDevicePixelRatio()]);
r3 = r8 === 'webp' && canAnimate;
r3 = r3 && isAnimatedIconHash(banner);
if (r3) {
object2.animated = true;
}
value = importDefault(1468) /* metro dependency 1468 */;
value = value.stringify(object2);
return r1 + ('?' + value);
}
}
function getAvatarDecorationURL({avatarDecoration, size, canAnimate}) { // fn#16613, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:3729, offset: 0x00e559bf, size: 550 bytes, params: 2, frame: 26
var r12;
var property;
var moduleValue2;
var CollectiblesItemAssetFormat;
var getCollectiblesItemAssetUrl;
var STATIC;
var ANIMATED;
var object2;
var skuId;
var collectiblesItemAssetUrl;
var value3;
var URL;
var value5;
var uRL;
var value8;
var error;
const r5 = size !== undefined ? size : AVATAR_DECORATION_SIZE;
canAnimate = !(canAnimate === undefined) && canAnimate;
if (avatarDecoration == null) {
return null;
}
const moduleValue = require(dependencyMap[9]);
if (moduleValue.isAvatarDecorationExpired(avatarDecoration)) {
return null;
}
try {
} catch (error) {
return null;
}
try {
} catch (error) {
return null;
}
try {
property = dependencyMap[10];
} catch (error) {
return null;
}
try {
moduleValue2 = require(property);
} catch (error) {
return null;
}
try {
CollectiblesItemAssetFormat = moduleValue2.CollectiblesItemAssetFormat;
} catch (error) {
return null;
}
try {
getCollectiblesItemAssetUrl = moduleValue2.getCollectiblesItemAssetUrl;
} catch (error) {
return null;
}
if (canAnimate) {
try {
ANIMATED = CollectiblesItemAssetFormat.ANIMATED;
} catch (error) {
return null;
}
r12 = ANIMATED;
} else {
try {
STATIC = CollectiblesItemAssetFormat.STATIC;
} catch (error) {
return null;
}
r12 = STATIC;
}
try {
object2 = {};
} catch (error) {
return null;
}
try {
skuId = avatarDecoration.skuId;
} catch (error) {
return null;
}
try {
object2.skuId = skuId;
} catch (error) {
return null;
}
try {
object2.assetFormat = r12;
} catch (error) {
return null;
}
try {
collectiblesItemAssetUrl = getCollectiblesItemAssetUrl(object2);
} catch (error) {
return null;
}
try {
value3 = collectiblesItemAssetUrl != null;
} catch (error) {
return null;
}
if (value3) {
return collectiblesItemAssetUrl;
}
const asset = avatarDecoration.asset;
if (asset == null) {
return null;
}
const {CDN_HOST, API_ENDPOINT} = global.window.GLOBAL_ENV;
const value4 = Endpoints.AVATAR_DECORATION_PRESETS(asset);
if (CDN_HOST != null) {
URL = global.URL;
value8 = 'https://' + CDN_HOST + value4;
uRL = new URL();
} else {
URL = global.URL;
value5 = '' + global.location.protocol + API_ENDPOINT + value4;
uRL = new URL();
}
let searchParams = undefined.searchParams;
const set = searchParams.set;
const moduleValue3 = require(dependencyMap[4]);
const getBestMediaProxySize = moduleValue3.getBestMediaProxySize;
const moduleValue4 = require(dependencyMap[4]);
const getDevicePixelRatio = moduleValue4.getDevicePixelRatio;
let value = Reflect.apply(getBestMediaProxySize, moduleValue3, [r5 * Reflect.apply(getDevicePixelRatio,
moduleValue4, []), env0_12]);
value = '' + value;
Reflect.apply(set, searchParams, ['size', value]);
searchParams = undefined.searchParams;
searchParams.set('passthrough', '' + canAnimate);
return undefined.toString();
}
function getGuildMemberBannerURL({id, guildId, banner, canAnimate, size}) { // fn#16614, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:4412, offset: 0x00e55be5, size: 369 bytes, params: 2, frame: 25
var r3;
var r1;
var CDN_HOST;
var value;
var value3;
var object2;
var moduleValue;
var getBestMediaProxySize;
var moduleValue2;
if (banner != null) {
if (guildId != null) {
CDN_HOST = global.window.GLOBAL_ENV.CDN_HOST;
value = 'png';
r3 = canAnimate && isAnimatedIconHash(banner) ? getAnimatedFormat(env0_11) : value;
value3 = Endpoints.GUILD_MEMBER_BANNER(guildId, id, banner, r3);
r1 = CDN_HOST != null ? 'https://' + CDN_HOST + value3 : global.location.protocol + global.window.GLOBAL_ENV.API_ENDPOINT + value3;
object2 = {};
moduleValue = require(1457) /* metro dependency 1457: ImageLoaderUtils */;
getBestMediaProxySize = moduleValue.getBestMediaProxySize;
moduleValue2 = require(1457) /* metro dependency 1457: ImageLoaderUtils */;
object2.size = Reflect.apply(getBestMediaProxySize, moduleValue,
[size * moduleValue2.getDevicePixelRatio()]);
r3 = r3 === 'webp' && canAnimate;
r3 = r3 && isAnimatedIconHash(banner);
if (r3) {
object2.animated = true;
}
value = importDefault(1468) /* metro dependency 1468 */;
value = value.stringify(object2);
return r1 + ('?' + value);
}
}
}
function getGuildSplashURL({id, splash, size}) { // fn#16615, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:4882, offset: 0x00e55d56, size: 282 bytes, params: 2, frame: 25
var r4;
var width;
var value;
if (splash == null) {
return null;
}
if (size != null) {
r4 = size;
} else {
width = global.window.screen.width;
value = require(1457) /* metro dependency 1457: ImageLoaderUtils */;
value = width * value.getDevicePixelRatio();
r4 = value;
}
const bestMediaProxySize = (require(1457) /* metro dependency 1457: ImageLoaderUtils */).getBestMediaProxySize(r4);
const GLOBAL_ENV = global.window.GLOBAL_ENV;
const CDN_HOST = GLOBAL_ENV.CDN_HOST;
return (CDN_HOST != null ? 'https://' + CDN_HOST + '/splashes/' + id + '/' + splash + '.jpg' : global.location.protocol + global.window.GLOBAL_ENV.API_ENDPOINT + Endpoints.GUILD_SPLASH(id,
splash)) + ('?size=' + bestMediaProxySize);
}
function getGuildBannerURL({id, banner}) { // fn#16616, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:5229, offset: 0x00e55e70, size: 401 bytes, params: 2, frame: 31
let value = a1;
const r7 = value !== undefined ? value : false;
if (banner == null) {
return null;
}
const bestMediaProxySize = (require(1457) /* metro dependency 1457: ImageLoaderUtils */).getBestMediaProxySize(360 * (require(1457) /* metro dependency 1457: ImageLoaderUtils */).getDevicePixelRatio());
const value4 = 'jpg';
let r2 = env0_11 ? 'webp' : value4;
const r9 = r7 && isAnimatedIconHash(banner) ? getAnimatedFormat(env0_11) : r2;
const GLOBAL_ENV = global.window.GLOBAL_ENV;
const CDN_HOST = GLOBAL_ENV.CDN_HOST;
r2 = CDN_HOST != null ? 'https://' + CDN_HOST + '/banners/' + id + '/' + banner + '.' + r9 : global.location.protocol + global.window.GLOBAL_ENV.API_ENDPOINT + Endpoints.GUILD_BANNER(id,
banner, r9);
const object2 = {size: bestMediaProxySize};
if (value4 === r9) {
object2.quality = 'lossless';
}
if (r9 === 'webp' && r7 && isAnimatedIconHash(banner)) {
object2.animated = true;
}
value = importDefault(1468) /* metro dependency 1468 */;
value = value.stringify(object2);
return r2 + ('?' + value);
}
function getGuildHomeHeaderURL({id, homeHeader}) { // fn#16617, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:5728, offset: 0x00e56001, size: 244 bytes, params: 2, frame: 25
if (homeHeader == null) {
return null;
}
const bestMediaProxySize = (require(1457) /* metro dependency 1457: ImageLoaderUtils */).getBestMediaProxySize(1096 * (require(1457) /* metro dependency 1457: ImageLoaderUtils */).getDevicePixelRatio());
const GLOBAL_ENV = global.window.GLOBAL_ENV;
const CDN_HOST = GLOBAL_ENV.CDN_HOST;
return (CDN_HOST != null ? 'https://' + CDN_HOST + '/home-headers/' + id + '/' + homeHeader + '.png' : global.location.protocol + global.window.GLOBAL_ENV.API_ENDPOINT + Endpoints.GUILD_HOME_HEADER(id,
homeHeader)) + ('?size=' + bestMediaProxySize);
}
function getResourceChannelIconURL({channelId, icon}) { // fn#16618, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:6055, offset: 0x00e560f5, size: 96 bytes, params: 2, frame: 15
const value = null;
return value == icon ? value : getAvatarURL({endpoint: Endpoints.GUILD_RESOURCE_CHANNELS_ICON,
path: 'resource-channels', id: channelId, hash: icon, size: AVATAR_SIZE, canAnimate: true, canWebP: false});
}
function getNewMemberActionIconURL({channelId, icon}) { // fn#16619, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:6257, offset: 0x00e56155, size: 96 bytes, params: 2, frame: 15
const value = null;
return value == icon ? value : getAvatarURL({endpoint: Endpoints.GUILD_NEW_MEMBER_ACTIONS_ICON,
path: 'new-member-actions', id: channelId, hash: icon, size: AVATAR_SIZE, canAnimate: true, canWebP: false});
}
function getGuildDiscoverySplashURL({id, splash, size}) { // fn#16620, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:6461, offset: 0x00e561b5, size: 282 bytes, params: 2, frame: 25
var r4;
var width;
var value;
if (splash == null) {
return null;
}
if (size != null) {
r4 = size;
} else {
width = global.window.screen.width;
value = require(1457) /* metro dependency 1457: ImageLoaderUtils */;
value = width * value.getDevicePixelRatio();
r4 = value;
}
const bestMediaProxySize = (require(1457) /* metro dependency 1457: ImageLoaderUtils */).getBestMediaProxySize(r4);
const GLOBAL_ENV = global.window.GLOBAL_ENV;
const CDN_HOST = GLOBAL_ENV.CDN_HOST;
return (CDN_HOST != null ? 'https://' + CDN_HOST + '/discovery-splashes/' + id + '/' + splash + '.jpg' : global.location.protocol + global.window.GLOBAL_ENV.API_ENDPOINT + Endpoints.GUILD_DISCOVERY_SPLASH(id,
splash)) + ('?size=' + bestMediaProxySize);
}
function getGuildIconURL_16621({id, icon, size, canAnimate, lossless}) { // fn#16621, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:6837, offset: 0x00e562cf, size: 115 bytes, params: 2, frame: 18
canAnimate = !(canAnimate === undefined) && canAnimate;
lossless = !(lossless === undefined) && lossless;
const getAvatarURLBinding = getAvatarURL;
const GUILD_ICON = Endpoints.GUILD_ICON;
return getAvatarURLBinding({endpoint: GUILD_ICON, path: 'icons', id: id, hash: icon, size: size,
canAnimate: canAnimate, lossless: lossless, canWebP: env0_11});
}
function getGuildTemplateIconURL({id, icon, size, canAnimate}) { // fn#16622, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:7025, offset: 0x00e56342, size: 109 bytes, params: 2, frame: 16
const r4 = size !== undefined ? size : AVATAR_SIZE;
canAnimate = !(canAnimate === undefined) && canAnimate;
const getAvatarURLBinding = getAvatarURL;
const GUILD_TEMPLATE_ICON = Endpoints.GUILD_TEMPLATE_ICON;
return getAvatarURLBinding({endpoint: GUILD_TEMPLATE_ICON, path: 'guild-templates', id: id, hash: icon, size: r4,
canAnimate: canAnimate, canWebP: false});
}
function getApplicationIconURL({id, icon, size, bot, botIconFirst, fallbackAvatar, keepAspectRatio, guildMember}) { // fn#16623, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:7218, offset: 0x00e563af, size: 342 bytes, params: 2, frame: 23
var userAvatarURLWithoutFallback;
var userAvatarURLWithoutFallback2;
const value = undefined;
const r7 = size !== value ? size : AVATAR_SIZE;
fallbackAvatar = fallbackAvatar === value || fallbackAvatar;
let id = bot == null ? value : bot.id;
if (id != null) {
if (guildMember == null) {
if (bot == null) {
if (icon != null) {
return isDataUri(icon) ? icon : getAvatarURL({endpoint: Endpoints.APPLICATION_ICON,
path: 'app-icons',
id: id,
hash: icon, size: r7, canAnimate: false, canWebP: false, keepAspectRatio: keepAspectRatio});
}
if (bot == null) {
return fallbackAvatar ? importDefault(1860) /* metro dependency 1860 */ : value;
}
userAvatarURLWithoutFallback2 = getUserAvatarURLWithoutFallback(bot, false, r7);
if (userAvatarURLWithoutFallback2 != null) {
return userAvatarURLWithoutFallback2;
}
return fallbackAvatar ? importDefault(1860) /* metro dependency 1860 */ : value;
}
if (botIconFirst) {
userAvatarURLWithoutFallback = getUserAvatarURLWithoutFallback(bot, false, r7);
if (userAvatarURLWithoutFallback != null) {
return userAvatarURLWithoutFallback;
}
if (icon != null) {
return isDataUri(icon) ? icon : getAvatarURL({endpoint: Endpoints.APPLICATION_ICON,
path: 'app-icons',
id: id,
hash: icon, size: r7, canAnimate: false, canWebP: false, keepAspectRatio: keepAspectRatio});
}
if (bot == null) {
return fallbackAvatar ? importDefault(1860) /* metro dependency 1860 */ : value;
}
userAvatarURLWithoutFallback2 = getUserAvatarURLWithoutFallback(bot, false, r7);
if (userAvatarURLWithoutFallback2 != null) {
return userAvatarURLWithoutFallback2;
}
return fallbackAvatar ? importDefault(1860) /* metro dependency 1860 */ : value;
}
if (icon != null) {
return isDataUri(icon) ? icon : getAvatarURL({endpoint: Endpoints.APPLICATION_ICON, path: 'app-icons',
id: id,
hash: icon, size: r7, canAnimate: false, canWebP: false, keepAspectRatio: keepAspectRatio});
}
if (bot == null) {
return fallbackAvatar ? importDefault(1860) /* metro dependency 1860 */ : value;
}
userAvatarURLWithoutFallback2 = getUserAvatarURLWithoutFallback(bot, false, r7);
if (userAvatarURLWithoutFallback2 != null) {
return userAvatarURLWithoutFallback2;
}
return fallbackAvatar ? importDefault(1860) /* metro dependency 1860 */ : value;
}
if (guildMember.avatar == null) {
if (bot == null) {
if (icon != null) {
return isDataUri(icon) ? icon : getAvatarURL({endpoint: Endpoints.APPLICATION_ICON,
path: 'app-icons',
id: id,
hash: icon, size: r7, canAnimate: false, canWebP: false, keepAspectRatio: keepAspectRatio});
}
if (bot == null) {
return fallbackAvatar ? importDefault(1860) /* metro dependency 1860 */ : value;
}
userAvatarURLWithoutFallback2 = getUserAvatarURLWithoutFallback(bot, false, r7);
if (userAvatarURLWithoutFallback2 != null) {
return userAvatarURLWithoutFallback2;
}
return fallbackAvatar ? importDefault(1860) /* metro dependency 1860 */ : value;
}
if (botIconFirst) {
userAvatarURLWithoutFallback = getUserAvatarURLWithoutFallback(bot, false, r7);
if (userAvatarURLWithoutFallback != null) {
return userAvatarURLWithoutFallback;
}
if (icon != null) {
return isDataUri(icon) ? icon : getAvatarURL({endpoint: Endpoints.APPLICATION_ICON,
path: 'app-icons',
id: id,
hash: icon, size: r7, canAnimate: false, canWebP: false, keepAspectRatio: keepAspectRatio});
}
if (bot == null) {
return fallbackAvatar ? importDefault(1860) /* metro dependency 1860 */ : value;
}
userAvatarURLWithoutFallback2 = getUserAvatarURLWithoutFallback(bot, false, r7);
if (userAvatarURLWithoutFallback2 != null) {
return userAvatarURLWithoutFallback2;
}
return fallbackAvatar ? importDefault(1860) /* metro dependency 1860 */ : value;
}
if (icon != null) {
return isDataUri(icon) ? icon : getAvatarURL({endpoint: Endpoints.APPLICATION_ICON, path: 'app-icons',
id: id,
hash: icon, size: r7, canAnimate: false, canWebP: false, keepAspectRatio: keepAspectRatio});
}
if (bot == null) {
return fallbackAvatar ? importDefault(1860) /* metro dependency 1860 */ : value;
}
userAvatarURLWithoutFallback2 = getUserAvatarURLWithoutFallback(bot, false, r7);
if (userAvatarURLWithoutFallback2 != null) {
return userAvatarURLWithoutFallback2;
}
return fallbackAvatar ? importDefault(1860) /* metro dependency 1860 */ : value;
}
var getGuildMemberAvatarURLSimpleBinding = getGuildMemberAvatarURLSimple;
id = bot.id;
var guildMemberAvatarURLSimpleBinding = getGuildMemberAvatarURLSimpleBinding({userId: id,
guildId: guildMember.guildId, avatar: guildMember.avatar, canAnimate: false, size: r7});
if (guildMemberAvatarURLSimpleBinding != null) {
return guildMemberAvatarURLSimpleBinding;
}
}
if (bot != null) {
if (botIconFirst) {
userAvatarURLWithoutFallback = getUserAvatarURLWithoutFallback(bot, false, r7);
if (userAvatarURLWithoutFallback != null) {
return userAvatarURLWithoutFallback;
}
if (icon != null) {
return isDataUri(icon) ? icon : getAvatarURL({endpoint: Endpoints.APPLICATION_ICON, path: 'app-icons',
id: id,
hash: icon, size: r7, canAnimate: false, canWebP: false, keepAspectRatio: keepAspectRatio});
}
if (bot == null) {
return fallbackAvatar ? importDefault(1860) /* metro dependency 1860 */ : value;
}
userAvatarURLWithoutFallback2 = getUserAvatarURLWithoutFallback(bot, false, r7);
if (userAvatarURLWithoutFallback2 != null) {
return userAvatarURLWithoutFallback2;
}
return fallbackAvatar ? importDefault(1860) /* metro dependency 1860 */ : value;
}
}
if (icon != null) {
return isDataUri(icon) ? icon : getAvatarURL({endpoint: Endpoints.APPLICATION_ICON, path: 'app-icons', id: id,
hash: icon, size: r7, canAnimate: false, canWebP: false, keepAspectRatio: keepAspectRatio});
}
if (bot != null) {
userAvatarURLWithoutFallback2 = getUserAvatarURLWithoutFallback(bot, false, r7);
if (userAvatarURLWithoutFallback2 != null) {
return userAvatarURLWithoutFallback2;
}
}
return fallbackAvatar ? importDefault(1860) /* metro dependency 1860 */ : value;
}
function getGameAssetURL({id, hash, size, keepAspectRatio, format}) { // fn#16624, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:7869, offset: 0x00e56505, size: 123 bytes, params: 2, frame: 17
const r3 = size !== undefined ? size : AVATAR_SIZE;
keepAspectRatio = !(keepAspectRatio === undefined) && keepAspectRatio;
const getAvatarURLBinding = getAvatarURL;
const APPLICATION_ICON = Endpoints.APPLICATION_ICON;
return getAvatarURLBinding({endpoint: APPLICATION_ICON, path: 'app-icons', id: id, hash: hash, size: r3,
canAnimate: false, keepAspectRatio: keepAspectRatio, format: format, canWebP: false});
}
function getVideoFilterAssetURL({userId, assetId, assetHash, size, canAnimate}) { // fn#16625, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:8087, offset: 0x00e56580, size: 132 bytes, params: 2, frame: 18
canAnimate = canAnimate === undefined || canAnimate;
return getAvatarURL({endpoint: function(a0, a1, a2) {
return Endpoints.VIDEO_FILTER_ASSET_STORAGE(userId, assetId, assetHash, a2);
}, path: 'video-filter-assets/' + userId, id: assetId, hash: assetHash, size: size, canAnimate: canAnimate,
canWebP: false});
}
function getChannelIconURL({id, icon, applicationId, size}) { // fn#16627, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:8330, offset: 0x00e5662c, size: 263 bytes, params: 2, frame: 21
var r0;
var value;
var avatarURL;
var DEFAULT_GROUP_DM_AVATARS;
if (applicationId != null) {
r0 = getApplicationIconURL({id: applicationId, icon: icon,
size: size}) ?? (require(1426) /* metro dependency 1426: AvatarUtils */).default.DEFAULT_CHANNEL_ICON;
} else {
avatarURL = getAvatarURL({endpoint: Endpoints.CHANNEL_ICON, path: 'channel-icons', id: id, hash: icon,
canAnimate: false, size: size, canWebP: false});
if (avatarURL != null) {
r0 = avatarURL;
} else {
DEFAULT_GROUP_DM_AVATARS = (require(1426) /* metro dependency 1426: AvatarUtils */).default.DEFAULT_GROUP_DM_AVATARS;
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
value = value.extractTimestamp(id);
r0 = DEFAULT_GROUP_DM_AVATARS[value % (require(1426) /* metro dependency 1426: AvatarUtils */).default.DEFAULT_GROUP_DM_AVATARS.length];
}
}
return r0;
}
function hasAnimatedGuildIcon(a0) { // fn#16628, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:8792, offset: 0x00e56733, size: 35 bytes, params: 2, frame: 13
return isAnimatedIconHash(a0?.icon);
}
function _getAssetHash(a0) { // fn#16631, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:9004, offset: 0x00e56794, size: 77 bytes, params: 2, frame: 12
var value;
var property;
var pathname;
var error;
try {
value = environment;
property = dependencyMap[13];
value = require(property);
value = value.parse(a0);
pathname = value.pathname;
value = pathname.split('/');
value = value.pop();
} catch (error) {
return null;
}
return value;
}
function getGuildBannerSource(a0) { // fn#16641, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:10645, offset: 0x00e568ec, size: 38 bytes, params: 2, frame: 14
const value = a1;
return makeSource(getGuildBannerURL(a0, value !== undefined ? value : false));
}
function getAnimatableSourceWithFallback(a0, a1) { // fn#16645, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:10899, offset: 0x00e56966, size: 138 bytes, params: 3, frame: 16
var r0;
var value3;
var items2;
var object2;
const value = a1(a0);
const moduleValue = require(dependencyMap[3]);
if (moduleValue.isAndroid()) {
if (a0) {
if (typeof value !== 'number') {
value3 = a1(false);
if (typeof value3 === 'number') {
items2 = [value];
object2 = {};
copyDataProperties(object2, value3, dependencyMap);
object2['isForceCached'] = true;
items2[1] = object2;
r0 = items2;
} else if (value3.uri === value.uri) {
r0 = value3;
} else {
items2 = [value];
object2 = {};
copyDataProperties(object2, value3, dependencyMap);
object2['isForceCached'] = true;
items2[1] = object2;
r0 = items2;
}
return r0;
}
return value;
}
}
return value;
}
function isAnimatedImageURL(a0) { // fn#16646, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:12274, offset: 0x00e569f0, size: 37 bytes, params: 2, frame: 13
return a0 != null && isAnimatedIconHash(_getAssetHash(a0));
}
function isVideoURL(a0) { // fn#16647, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1550:12373, offset: 0x00e56a15, size: 37 bytes, params: 2, frame: 13
return a0 != null && isVideoAssetHash(_getAssetHash(a0));
}
+37
View File
@@ -0,0 +1,37 @@
/* Metro module 3792; source: utils/BasicPermissionUtils.tsx; dependencies: [6, 7, 483, 2] */
function _fun28835(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#28835, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3919:6, offset: 0x00f8474c, size: 143 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(6) /* metro dependency 6 */;
const env0_3 = importDefault(7) /* metro dependency 7 */;
const value = _fun28836();
value.cache = {};
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/BasicPermissionUtils.tsx');
exports.default = value;
}
function _fun28836() { // fn#28836, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3919:118, offset: 0x00f847db, size: 106 bytes, params: 1, frame: 16
return env0_3(BasicPermissionUtils, null, [{key: 'has', value: function(a0, a1) {
return !!(a0 & a1);
}}, {key: 'asBasicFlag', value: value_28839}, {key: 'asBigFlag', value: value_28840}]);
}
function value_28839(a0) { // fn#28839, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3919:280, offset: 0x00f84845, size: 45 bytes, params: 2, frame: 13
const value = environment.__proto__;
return (importAll(483) /* metro dependency 483: BigFlagUtils */).asUintN(20, a0);
}
function value_28840(a0) { // fn#28840, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3919:346, offset: 0x00f84872, size: 93 bytes, params: 2, frame: 15
var value;
const Object = global.Object;
const hasOwn = Object.hasOwn;
let cache = this.cache;
if (!Reflect.apply(hasOwn, Object, [cache, a0])) {
cache = this.cache;
value = environment.__proto__;
value = importAll(483) /* metro dependency 483: BigFlagUtils */;
cache[a0] = value.deserialize(a0);
}
return this.cache[a0];
}
+120
View File
@@ -0,0 +1,120 @@
/* Metro module 3817; source: utils/BillingUtils.tsx; dependencies: [5, 482, 3818, 1216, 507, 3824, 2] */
function _fun29519(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#29519, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3944:6, offset: 0x00fc423d, size: 204 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
const env0_4 = (require(482) /* metro dependency 482: Constants */).PaymentGateways;
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/BillingUtils.tsx');
exports.getLocalizedDisplayMonth = function(a0, a1) {
var Date = global.Date;
var value2 = new Date();
value2.setMonth(a0 - 1);
return value2.toLocaleString(a1, {month: 'short'});
};
exports.createGatewayCheckoutContext = function() {
return _createGatewayCheckoutContext.apply(this, arguments);
};
exports.captureBillingException = captureBillingException;
exports.isExpectedHttpClientError = isExpectedHttpClientError;
exports.captureBillingMessage = captureBillingMessage;
exports.calculateStandardizedUnits = calculateStandardizedUnits;
}
function _createGatewayCheckoutContext() { // fn#29520, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3944:134, offset: 0x00fc4309, size: 48 bytes, params: 1, frame: 14
return env0_3(_fun29522).apply(this, arguments);
}
function captureBillingException(a0, a1) { // fn#29525, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3944:754, offset: 0x00fc4405, size: 110 bytes, params: 3, frame: 17
const value = undefined;
const defaultImport = importDefault(1216) /* metro dependency 1216: SentryUtilsNative */;
const captureException = defaultImport.captureException;
const object3 = {};
copyDataProperties(object3, a1, undefined);
const object4 = {};
const value2 = a1 == null;
copyDataProperties(object4, value2 ? value : a1.tags, value2);
object4['app_context'] = 'billing';
object3['tags'] = object4;
Reflect.apply(captureException, defaultImport, [a0, object3]);
return value;
}
function isExpectedHttpClientError(a0) { // fn#29526, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3944:911, offset: 0x00fc4473, size: 156 bytes, params: 2, frame: 14
var r1;
const HTTPResponseError = (require(507) /* metro dependency 507: HTTPUtils */).HTTPResponseError;
let r0 = a0 instanceof HTTPResponseError && a0.status >= 400 && a0.status < 500;
if (!r0) {
r1 = a0 instanceof (importDefault(3824) /* metro dependency 3824: BillingError */) && a0.status != null;
r1 = r1 && a0.status >= 400;
r1 = r1 && a0.status < 500;
r0 = r1;
}
return r0;
}
function captureBillingMessage(a0, a1) { // fn#29527, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3944:1117, offset: 0x00fc450f, size: 110 bytes, params: 3, frame: 17
const value = undefined;
const defaultImport = importDefault(1216) /* metro dependency 1216: SentryUtilsNative */;
const captureMessage = defaultImport.captureMessage;
const object3 = {};
copyDataProperties(object3, a1, undefined);
const object4 = {};
const value2 = a1 == null;
copyDataProperties(object4, value2 ? value : a1.tags, value2);
object4['app_context'] = 'billing';
object3['tags'] = object4;
Reflect.apply(captureMessage, defaultImport, [a0, object3]);
return value;
}
function calculateStandardizedUnits(a0, a1) { // fn#29528, offset: 0x00fc457d, size: 182 bytes, params: 3, frame: 6
let value = a0 === 'P1M';
if ((value && a1 === 'P1Y') === true) {
return 12;
}
if ((value && a1 === 'P6M') === true) {
return 6;
}
if ((value && a1 === 'P3M') === true) {
return 3;
}
value = a0 === 'P3M';
if ((value && a1 === 'P1Y') === true) {
return 4;
}
if ((value && a1 === 'P6M') === true) {
return 2;
}
if ((a0 === 'P6M' && a1 === 'P1Y') === true) {
return 2;
}
return 1;
}
function* _fun29522(a0) { // fn#29522, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3944:215, offset: 0x00fc4342, size: 118 bytes, params: 2, frame: 14
var paymentGateway;
var value3;
var value4;
var value5;
if (false) {
return undefined;
}
value = null;
if (value != a0) {
paymentGateway = a0.paymentGateway;
value3 = environment.__proto__.__proto__;
if (paymentGateway !== env2_4.BRAINTREE) {
return value;
}
value4 = env2_0(env2_2[2]);
yield value4.collectDeviceData();
value5 = undefined;
if (false) {
return value5;
}
return value != value5 ? {braintree_device_data: value5} : value;
}
return value;
}
+71
View File
@@ -0,0 +1,71 @@
/* Metro module 3818; source: utils/BraintreeUtils.tsx; dependencies: [3819, 661, 3820, 3823, 1962, 3823, 2] */
function _fun29529(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#29529, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3945:6, offset: 0x00fc4633, size: 160 bytes, params: 8, frame: 19
const env0_0 = require;
const closure = getBraintreeSDK;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const braintreeStore = importDefault(3819) /* metro dependency 3819: BraintreeStore */;
const env0_3 = (require(661) /* metro dependency 661: Constants */).PaymentSettings;
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/BraintreeUtils.tsx');
exports.getBraintreeSDK = closure;
exports.collectDeviceData = collectDeviceData;
}
function getBraintreeSDK() { // fn#29530, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3945:132, offset: 0x00fc46d3, size: 79 bytes, params: 1, frame: 14
var value;
value = Reflect.apply(require(dependencyMap[2]).importWithRetry, value, [{createPromise: createPromise,
webpackId: dependencyMap[5]}]);
return value.then(function(a0) {
return a0.default;
});
}
function getDeviceData(a0) { // fn#29533, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3945:273, offset: 0x00fc4759, size: 39 bytes, params: 2, frame: 11
const env0_0 = a0;
return getBraintreeSDK().then(_fun29534);
}
function collectDeviceData() { // fn#29537, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3945:524, offset: 0x00fc47cf, size: 65 bytes, params: 1, frame: 12
var r0;
var value;
const client = BraintreeStore.getClient();
if (client == null) {
value = getBraintreeSDK();
value = value.then(_fun29538);
r0 = value;
} else {
r0 = getDeviceData(client);
}
return r0;
}
function createPromise() { // fn#29531, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3945:205, owner: getBraintreeSDK.createPromise, offset: 0x00fc4722, size: 45 bytes, params: 1, frame: 13
const value = environment.__proto__;
return require(dependencyMap[4])(dependencyMap[3], dependencyMap.paths);
}
function _fun29534({dataCollector}) { // fn#29534, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3945:330, offset: 0x00fc4780, size: 68 bytes, params: 2, frame: 13
let value = dataCollector.create({client: env0_0});
value = value.then(function(a0) {
return a0.deviceData;
});
return value.catch(function() {
return null;
});
}
function _fun29538({client}) { // fn#29538, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3945:612, offset: 0x00fc4810, size: 80 bytes, params: 2, frame: 13
var environment;
const create = client.create;
let value = environment.__proto__;
const BRAINTREE = PaymentSettings.BRAINTREE;
const KEY = BRAINTREE.KEY;
value = Reflect.apply(create, client, [{authorization: KEY}]);
value = value.then(function(a0) {
return getDeviceData(a0);
});
return value.catch(function() {
return null;
});
}
+79
View File
@@ -0,0 +1,79 @@
/* Metro module 4221; source: utils/BrowserUtils.tsx; dependencies: [4222, 2] */
function _fun34546(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#34546, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4392:6, offset: 0x01059299, size: 607 bytes, params: 8, frame: 31
var parseInt;
var version;
var int;
var int2;
var int3;
var int4;
const closure = getChromeVersion;
const closure2 = getElectronVersion;
const closure3 = getFirefoxVersion;
const closure4 = getEdgeVersion;
const closure5 = getSafariVersion;
const closure6 = function() {
var r0;
var value = a0;
value = (value !== undefined ? value : global.navigator.userAgent).toLowerCase();
r0 = value.indexOf('safari') !== -1 && !(value.indexOf('chrome') !== -1);
if (r0) {
value = value.indexOf('version/') !== -1;
r0 = value;
}
return r0;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
value = ((importDefault(4222) /* metro dependency 4222 */).name ?? 'unknown').toLowerCase();
if (value.toLowerCase() === 'chrome') {
int = global.parseInt((importDefault(4222) /* metro dependency 4222 */).version ?? '', 10);
}
if (value.toLowerCase() === 'electron') {
int2 = global.parseInt((importDefault(4222) /* metro dependency 4222 */).version ?? '', 10);
}
if (value.toLowerCase() === 'firefox') {
int3 = global.parseInt((importDefault(4222) /* metro dependency 4222 */).version ?? '', 10);
}
if (value.toLowerCase() === 'edge') {
int4 = global.parseInt((importDefault(4222) /* metro dependency 4222 */).version ?? '', 10);
}
value = value.toLowerCase();
if (value === 'safari') {
parseInt = global.parseInt;
version = (importDefault(4222) /* metro dependency 4222 */).version;
value = '';
value = parseInt(version ?? value, 10);
}
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/BrowserUtils.tsx');
exports.getChromeVersion = closure;
exports.getElectronVersion = closure2;
exports.getFirefoxVersion = closure3;
exports.getEdgeVersion = closure4;
exports.getSafariVersion = closure5;
exports.canUseWebp = canUseWebp_34553;
exports.isSafari = closure6;
exports.isFirefox = function() {
var value = a0;
value = (value !== undefined ? value : global.navigator.userAgent).toLowerCase();
value = value.indexOf('firefox');
return value !== -1;
};
exports.supportsHEVCAlpha = function() {
var navigator = global.window.navigator;
return isSafari(navigator.userAgent) && navigator.mediaCapabilities?.decodingInfo != null;
};
}
function canUseWebp_34553() { // fn#34553, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4392:1150, offset: 0x01059567, size: 88 bytes, params: 1, frame: 12
var value;
let r0 = getChromeVersion() !== -1 || getElectronVersion() !== -1;
r0 = !r0 ? getFirefoxVersion() !== -1 : r0;
r0 = !r0 ? getEdgeVersion() !== -1 : r0;
if (!r0) {
value = getSafariVersion();
value = value >= 14;
r0 = value;
}
return r0;
}
+170
View File
@@ -0,0 +1,170 @@
/* Metro module 8339; source: utils/ChangeLogUtils.tsx; dependencies: [3855, 8340, 6629, 6644, 6645, 6622, 2] */
function _fun66399(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#66399, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8524:6, offset: 0x01bf9fea, size: 412 bytes, params: 8, frame: 20
var object2;
let env0_0 = require;
const parseWithClassNameExtraction = function({transformUpperCase = false}) {
var env0_0 = transformUpperCase;
return _fun66401;
};
const closure = function(a0) {
var object = {};
var defaultRules_2Binding = defaultRules_2;
copyDataProperties(object, defaultRules_2Binding(a0), defaultRules_2Binding);
return object;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = (importDefault(3855) /* metro dependency 3855 */).defaultRules.lheading;
const env0_4 = (importDefault(3855) /* metro dependency 3855 */).defaultRules.heading;
const env0_5 = (importDefault(3855) /* metro dependency 3855 */).defaultRules.link;
const env0_6 = (importDefault(3855) /* metro dependency 3855 */).defaultRules.image;
const env0_7 = (importDefault(3855) /* metro dependency 3855 */).defaultRules.list;
const env0_8 = (importDefault(3855) /* metro dependency 3855 */).defaultRules.blockQuote;
const env0_9 = (importDefault(3855) /* metro dependency 3855 */).defaultRules.paragraph;
const env0_10 = RegExp('\\{(.+?)}', '');
const env0_11 = RegExp('^\\$(\\w+?)\\$', '');
object2 = {getDefaultRules: closure, getSpecialRules: function(a0) {
var object = {};
var defaultRules_2Binding = defaultRules_2;
copyDataProperties(object, specialRules(a0), copyDataProperties(object, defaultRules_2Binding(a0),
defaultRules_2Binding));
return object;
}, getMessageRules: function(a0) {
var object = {};
var messageRulesBinding = messageRules;
copyDataProperties(object, messageRulesBinding(a0), messageRulesBinding);
return object;
}};
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/ChangeLogUtils.tsx');
exports.default = object2;
exports.renderChangelogMessageMarkup = renderChangelogMessageMarkup;
}
function parseWithClassNameExtraction({transformUpperCase}) { // fn#66400, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8524:340, offset: 0x01bfa186, size: 32 bytes, params: 2, frame: 3
if (transformUpperCase !== undefined) {
}
return _fun66401;
}
function defaultRules(a0) { // fn#66402, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8524:578, offset: 0x01bfa249, size: 1077 bytes, params: 2, frame: 20
var r10;
var r1;
const object7 = {};
copyDataProperties(object7, (require(8340) /* metro dependency 8340: ChangeLogUtils */).baseRules, r10);
const object11 = {};
copyDataProperties(object11, image, r10);
const customRules = (require(8340) /* metro dependency 8340: ChangeLogUtils */).customRules;
if (typeof customRules.image === 'function') {
r1 = customRules.image(a0);
r10 = customRules;
} else {
r1 = customRules.image;
}
copyDataProperties(object11, r1, r10);
object7['image'] = object11;
const object12 = {};
copyDataProperties(object12, link, r10);
if (typeof customRules.link === 'function') {
r1 = customRules.link(a0);
r10 = customRules;
} else {
r1 = customRules.link;
}
copyDataProperties(object12, r1, r10);
object7['link'] = object12;
const object13 = {};
copyDataProperties(object13, list, r10);
if (typeof customRules.list === 'function') {
r1 = customRules.list(a0);
r10 = customRules;
} else {
r1 = customRules.list;
}
copyDataProperties(object13, r1, r10);
object7['list'] = object13;
const object14 = {};
object14.order = (importDefault(6629) /* metro dependency 6629: MarkupTextRule */).order;
object14.match = match_66403;
object14.parse = function(a0, a1, {interpolations}) {
interpolations = interpolations[a0[1]];
return interpolations == null ? {type: 'text', content: a0[0]} : {type: 'interpolation',
renderer: interpolations};
};
object14.react = function(a0) {
return a0.renderer();
};
object7['interpolation'] = object14;
const object15 = {};
copyDataProperties(object15, lheading, importDefault);
object15['parse'] = parseWithClassNameExtraction({transformUpperCase: true});
copyDataProperties(object15,
typeof customRules.lheading === 'function' ? customRules.lheading(a0) : customRules.lheading, true);
object7['lheading'] = object15;
const object16 = {};
copyDataProperties(object16, heading, true);
copyDataProperties(object16,
typeof customRules.heading === 'function' ? customRules.heading(a0) : customRules.heading, true);
object7['heading'] = object16;
const object17 = {};
copyDataProperties(object17, blockQuote, true);
copyDataProperties(object17,
typeof customRules.blockQuote === 'function' ? customRules.blockQuote(a0) : customRules.blockQuote, true);
object7['blockQuote'] = object17;
const object18 = {};
copyDataProperties(object18, paragraph, true);
copyDataProperties(object18,
typeof customRules.paragraph === 'function' ? customRules.paragraph(a0) : customRules.paragraph, true);
object7['paragraph'] = object18;
return object7;
}
function specialRules(a0) { // fn#66406, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8524:1748, offset: 0x01bfa6ef, size: 175 bytes, params: 2, frame: 16
const object = {};
copyDataProperties(object, lheading, undefined);
object['parse'] = parseWithClassNameExtraction({transformUpperCase: false});
const customRules = (require(8340) /* metro dependency 8340: ChangeLogUtils */).customRules;
copyDataProperties(object,
typeof customRules.lheading === 'function' ? customRules.lheading(a0) : customRules.lheading, 1);
return {lheading: object};
}
function messageRules(a0) { // fn#66407, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8524:1969, offset: 0x01bfa79e, size: 140 bytes, params: 2, frame: 15
const object3 = {};
copyDataProperties(object3, defaultRules_2(a0), undefined);
const object4 = {};
copyDataProperties(object4, (importDefault(3855) /* metro dependency 3855 */).defaultRules.newline, object4);
object3['newline'] = object4;
object3['text'] = importDefault(6629) /* metro dependency 6629: MarkupTextRule */;
object3['list'] = importDefault(6644) /* metro dependency 6644: MarkupListRule */;
object3['subtext'] = importDefault(6645) /* metro dependency 6645: MarkupSubtextRule */;
return object3;
}
function renderChangelogMessageMarkup({content}, a1, a2) { // fn#66411, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8524:2404, offset: 0x01bfa88e, size: 108 bytes, params: 4, frame: 18
const object2 = {'hasSpoilerEmbeds': false, 'hasBailedAst': false};
const defaultImport = importDefault(6622) /* metro dependency 6622: MarkupUtils */;
object2.content = defaultImport.reactParserFor(getDefaultRules(a1))(content, false,
a2 != null ? {changeLog: a2} : {});
return object2;
}
function _fun66401(a0, a1, a2) { // fn#66401, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8524:411, offset: 0x01bfa1a6, size: 163 bytes, params: 4, frame: 18
const value = environment.__proto__;
const binding = env1_10;
const value2 = 1;
const value3 = binding.exec(a0[value2]);
const value4 = a0[value2].replace(env1_10, '');
const r5 = transformUpperCase ? value4.toUpperCase() : value4;
const object2 = {};
const value7 = null;
object2.className = value7 != value3 ? value3[value2] : value7;
const value8 = 2;
object2.level = a0[value8] !== '=' ? value8 : value2;
object2.content = (importDefault(3855) /* metro dependency 3855 */).parseInline(a1, r5, a2);
return object2;
}
function defaultRulesMatch(a0) { // fn#66403, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8524:1012, owner: defaultRules.match, offset: 0x01bfa67e, size: 23 bytes, params: 2, frame: 11
return env1_11.exec(a0);
}
+503
View File
@@ -0,0 +1,503 @@
/* Metro module 15936; source: utils/ChannelSortingUtils.tsx; dependencies: [1383, 661, 11879, 5099, 2] */
function _fun122953(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#122953, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16144:6, offset: 0x0257bdab, size: 217 bytes, params: 8, frame: 19
const closure = function(a0, a1) {
var r0;
var r1;
r0 = a0 != null && a1 != null;
if (r0) {
r1 = a0 === a1 || isGuildSelectableChannelType(a0) && isGuildSelectableChannelType(a1);
r1 = !r1 ? isGuildVocalChannelType(a0) && isGuildVocalChannelType(a1) : r1;
r0 = r1;
}
return r0;
};
const hoverSameType = function(a0) {
return {referenceId: a0.id, parentId: a0.parent_id};
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const channelRecordModule = require(1383) /* metro dependency 1383: ChannelRecord */;
const env0_2 = channelRecordModule.isGuildSelectableChannelType;
const env0_3 = channelRecordModule.isGuildVocalChannelType;
const env0_4 = (require(661) /* metro dependency 661: Constants */).ChannelTypes;
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/ChannelSortingUtils.tsx');
exports.areTypesInSameSection = closure;
exports.getDropData = getDropData;
exports.getDnDUpdates = getDnDUpdates;
}
function getFirstChannelOfType(a0, a1, a2, a3) { // fn#122955, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16144:283, offset: 0x0257bee3, size: 132 bytes, params: 5, frame: 19
var r4;
var length;
var property;
var areTypesInSameSectionBinding;
var channel;
var type;
var value2;
const env0_0 = a1;
const env0_1 = -1;
a3.find(_fun122956);
if (!(env0_1 < 0)) {
var binding = env0_1;
if (binding >= 0) {
length = a3.length;
if (binding < length) {
r4 = binding;
loopExit3: while (true) {
property = a3[r4];
areTypesInSameSectionBinding = areTypesInSameSection;
channel = property.channel;
type = channel.type;
if (areTypesInSameSectionBinding(type, a2)) {
return property;
}
value2 = r4 + a0;
if (value2 >= 0) {
length = a3.length;
if (value2 < length) {
r4 = value2;
continue;
}
break loopExit3;
}
break loopExit3;
}
return null;
}
return null;
}
}
return null;
}
function getChannelPosition(a0, a1) { // fn#122957, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16144:507, offset: 0x0257bf8d, size: 86 bytes, params: 3, frame: 14
const value = a2;
const env0_0 = a0;
const env0_1 = value !== undefined ? value : false;
if (a0 == null) {
return 0;
}
const env0_2 = null;
a1.filter(_fun122958).find(_fun122959);
return env0_2;
}
function getDropData(a0, a1, a2, a3, a4) { // fn#122961, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16144:918, offset: 0x0257c078, size: 1383 bytes, params: 6, frame: 27
var r6;
var r1;
var id;
var r9;
var r2;
var areTypesInSameSectionBinding;
var channelPosition;
var property;
var getFirstChannelOfTypeBinding;
var firstChannelOfType;
var channel;
var object2;
var channelPosition2;
var firstChannelOfTypeBinding;
var isGuildSelectableChannelTypeBinding;
var channelPosition3;
var firstChannelOfType2;
var channelPosition4;
var firstChannelOfTypeBinding2;
var channelPosition5;
var firstChannelOfType3;
const value = null;
if (value == a0) {
return value;
}
if (value == a2) {
return value;
}
let GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
if (a0.type === GUILD_CATEGORY) {
if (a3 === a1) {
r2 = hoverSameType(a2);
} else if (a3 < a1) {
if (a0.type === a2.type) {
r2 = hoverSameType(a2);
} else if (a3 > a1) {
GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
channelPosition5 = getChannelPosition(a2, a4, true);
property = a4[(value != channelPosition5 ? channelPosition5 : 0) + 1];
firstChannelOfType3 = getFirstChannelOfType(-1, a2.id, a0.type, a4);
r2 = value == firstChannelOfType3 || firstChannelOfType3.channel.id === a0.id ? value : value == property ? {referenceId: firstChannelOfType3.channel.id,
parentId: value} : property.channel.type !== GUILD_CATEGORY ? value : {referenceId: firstChannelOfType3.channel.id,
parentId: value};
} else {
r2 = value;
}
} else if (a3 > a1) {
GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
channelPosition5 = getChannelPosition(a2, a4, true);
property = a4[(value != channelPosition5 ? channelPosition5 : 0) + 1];
firstChannelOfType3 = getFirstChannelOfType(-1, a2.id, a0.type, a4);
r2 = value == firstChannelOfType3 || firstChannelOfType3.channel.id === a0.id ? value : value == property ? {referenceId: firstChannelOfType3.channel.id,
parentId: value} : property.channel.type !== GUILD_CATEGORY ? value : {referenceId: firstChannelOfType3.channel.id,
parentId: value};
} else {
r2 = value;
}
r1 = r2;
} else {
areTypesInSameSectionBinding = areTypesInSameSection;
if (areTypesInSameSectionBinding(a0.type, a2.type)) {
r1 = hoverSameType(a2);
} else if (a3 < a1) {
if (a2.type === GUILD_CATEGORY) {
channelPosition4 = getChannelPosition(a2, a4, true);
r9 = value != channelPosition4 ? channelPosition4 : 0;
property = a4[r9 - 1];
getFirstChannelOfTypeBinding = getFirstChannelOfType;
id = a2.id;
firstChannelOfTypeBinding2 = getFirstChannelOfTypeBinding(1, id, a0.type, a4);
if (value == property) {
r9 = {'referenceId': null, 'parentId': null};
} else if (value != firstChannelOfTypeBinding2) {
areTypesInSameSectionBinding = areTypesInSameSection;
channel = property.channel;
if (areTypesInSameSectionBinding(channel.type, a0.type)) {
object2 = {};
channel = firstChannelOfTypeBinding2.channel;
object2.referenceId = channel.id;
channel = property.channel;
object2.parentId = channel.parent_id;
r9 = object2;
} else if (a0.isGuildVocal()) {
isGuildSelectableChannelTypeBinding = isGuildSelectableChannelType;
channel = property.channel;
if (isGuildSelectableChannelTypeBinding(channel.type)) {
object2 = {};
channel = firstChannelOfTypeBinding2.channel;
object2.referenceId = channel.id;
channel = property.channel;
object2.parentId = channel.parent_id;
r9 = object2;
} else {
channel = property.channel;
if (channel.isCategory()) {
object2 = {};
channel = firstChannelOfTypeBinding2.channel;
id = channel.id;
object2.referenceId = id;
channel = property.channel;
id = channel.id;
object2.parentId = id;
r9 = object2;
} else {
r9 = value;
}
}
} else {
channel = property.channel;
if (channel.isCategory()) {
object2 = {};
channel = firstChannelOfTypeBinding2.channel;
id = channel.id;
object2.referenceId = id;
channel = property.channel;
id = channel.id;
object2.parentId = id;
r9 = object2;
} else {
r9 = value;
}
}
} else {
r9 = value;
}
r6 = r9;
} else {
channelPosition3 = getChannelPosition(a2, a4, true);
r6 = value != channelPosition3 ? channelPosition3 : 0;
property = a4[r6 - 1];
firstChannelOfType2 = getFirstChannelOfType(1, a2.id, a0.type, a4);
r6 = value != property || a0.isGuildVocal() ? isGuildSelectableChannelType(a0.type) && value != firstChannelOfType2 && (isGuildSelectableChannelType(property.channel.type) || property.channel.isCategory()) ? {referenceId: firstChannelOfType2.channel.id,
parentId: a2.parent_id} : value : {referenceId: value != firstChannelOfType2 ? firstChannelOfType2.channel.id : value,
parentId: value};
}
r1 = r6;
} else if (a2.type === GUILD_CATEGORY) {
channelPosition2 = getChannelPosition(a2, a4, true);
property = a4[(value != channelPosition2 ? channelPosition2 : 0) + 1];
getFirstChannelOfTypeBinding = getFirstChannelOfType;
id = a2.id;
firstChannelOfTypeBinding = getFirstChannelOfTypeBinding(-1, id, a0.type, a4);
if (value != firstChannelOfTypeBinding) {
if (value == property) {
object2 = {};
id = firstChannelOfTypeBinding.channel.id;
object2.referenceId = id;
id = a2.id;
object2.parentId = id;
r6 = object2;
} else {
areTypesInSameSectionBinding = areTypesInSameSection;
channel = property.channel;
if (areTypesInSameSectionBinding(channel.type, a0.type)) {
object2 = {};
channel = firstChannelOfTypeBinding.channel;
object2.referenceId = channel.id;
channel = property.channel;
object2.parentId = channel.parent_id;
r6 = object2;
} else if (isGuildSelectableChannelType(a0.type)) {
channel = property.channel;
if (channel.isGuildVocal()) {
object2 = {};
channel = firstChannelOfTypeBinding.channel;
object2.referenceId = channel.id;
channel = property.channel;
object2.parentId = channel.parent_id;
r6 = object2;
} else {
channel = property.channel;
if (channel.isCategory()) {
object2 = {};
id = firstChannelOfTypeBinding.channel.id;
object2.referenceId = id;
id = a2.id;
object2.parentId = id;
r6 = object2;
} else {
r6 = value;
}
}
} else {
channel = property.channel;
if (channel.isCategory()) {
object2 = {};
id = firstChannelOfTypeBinding.channel.id;
object2.referenceId = id;
id = a2.id;
object2.parentId = id;
r6 = object2;
} else {
r6 = value;
}
}
}
} else {
r6 = value;
}
r1 = r6;
} else {
channelPosition = getChannelPosition(a2, a4, true);
property = a4[(value != channelPosition ? channelPosition : 0) + 1];
firstChannelOfType = getFirstChannelOfType(-1, a2.id, a0.type, a4);
if (value == firstChannelOfType) {
r1 = value;
} else if (a0.isGuildVocal()) {
if (value == property) {
r1 = {referenceId: firstChannelOfType.channel.id, parentId: a2.parent_id};
} else {
channel = property.channel;
if (channel.isCategory()) {
r1 = {referenceId: firstChannelOfType.channel.id, parentId: a2.parent_id};
} else {
channel = property.channel;
if (channel.isGuildVocal()) {
object2 = {};
channel = firstChannelOfType.channel;
object2.referenceId = channel.id;
channel = property.channel;
object2.parentId = channel.parent_id;
r1 = object2;
} else {
r1 = a0.isCategory() && (value == property || property.channel.isCategory()) ? {referenceId: firstChannelOfType.channel.id,
parentId: value} : value;
}
}
}
} else {
r1 = a0.isCategory() && (value == property || property.channel.isCategory()) ? {referenceId: firstChannelOfType.channel.id,
parentId: value} : value;
}
}
}
return r1;
}
function getDnDUpdates(a0, a1, a2, a3) { // fn#122962, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16144:3153, offset: 0x0257c5df, size: 441 bytes, params: 5, frame: 24
var r1;
var value;
var getChannelPositionBinding;
var value3;
var value4;
const env0_0 = a0;
const env0_1 = a2;
const env0_4 = [];
let items = [];
const _categories = a3._categories;
const closure = generateUpdates;
if (a0.isCategory()) {
items = [];
arraySpread(items, _categories, 0, undefined);
value = items.slice(1);
getChannelPositionBinding = getChannelPosition;
var env0_2 = getChannelPositionBinding(a0, value);
var env0_3 = getChannelPositionBinding(a1, value);
value = closure(value);
value.unshift(_categories[0]);
r1 = value;
} else {
r1 = items;
}
if (isGuildSelectableChannelType(a0.type)) {
value3 = (importDefault(5099) /* metro dependency 5099: getFlattedChannelList */)(r1.length > 0 ? r1 : _categories,
a3, function(a0) {
return isGuildSelectableChannelType(a0.channel.type);
});
getChannelPositionBinding = getChannelPosition;
env0_2 = getChannelPositionBinding(a0, value3);
env0_3 = getChannelPositionBinding(a1, value3);
closure(value3);
} else if (a0.isCategory()) {
value3 = (importDefault(5099) /* metro dependency 5099: getFlattedChannelList */)(r1.length > 0 ? r1 : _categories,
a3, _fun122966);
getChannelPositionBinding = getChannelPosition;
env0_2 = getChannelPositionBinding(a0, value3);
env0_3 = getChannelPositionBinding(a1, value3);
closure(value3);
}
if (a0.isGuildVocal()) {
value4 = (importDefault(5099) /* metro dependency 5099: getFlattedChannelList */)(r1.length > 0 ? r1 : _categories,
a3, function({channel}) {
return channel.isGuildVocal();
});
getChannelPositionBinding = getChannelPosition;
env0_2 = getChannelPositionBinding(a0, value4);
env0_3 = getChannelPositionBinding(a1, value4);
closure(value4);
} else if (a0.isCategory()) {
value4 = (importDefault(5099) /* metro dependency 5099: getFlattedChannelList */)(r1.length > 0 ? r1 : _categories,
a3, _fun122967);
getChannelPositionBinding = getChannelPosition;
env0_2 = getChannelPositionBinding(a0, value4);
env0_3 = getChannelPositionBinding(a1, value4);
closure(value4);
}
value = a0.parent_id !== a2;
if (value) {
value = env0_4.find(_fun122968);
value = value == null;
r1 = value;
} else {
r1 = value;
}
if (r1) {
env0_4.push({id: a0.id, parent_id: a2});
}
return env0_4;
}
function _fun122956({channel}, a1) { // fn#122956, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16144:343, offset: 0x0257bf67, size: 38 bytes, params: 3, frame: 3
return channel.id === require && true;
}
function _fun122958({channel}) { // fn#122958, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16144:593, offset: 0x0257bfe3, size: 65 bytes, params: 2, frame: 15
return env0_0 != null && (env0_1 || areTypesInSameSection(env0_0.type, channel.type));
}
function _fun122959({channel}, a1) { // fn#122959, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16144:669, offset: 0x0257c024, size: 56 bytes, params: 3, frame: 4
return env0_0 != null && channel.id === env0_0.id && true;
}
function generateUpdates(a0) { // fn#122963, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16144:3235, owner: getDnDUpdates.generateUpdates, offset: 0x0257c798, size: 246 bytes, params: 2, frame: 19
var environment;
var r0;
var binding;
var binding2;
var binding3;
var items;
var value7;
var defaultImport;
if (env0_2 == null) {
items = [];
arraySpread(items, a0, 0, a0);
r0 = items;
} else if (env0_3 == null) {
items = [];
arraySpread(items, a0, 0, a0);
r0 = items;
} else {
binding = env0_0;
binding2 = env0_2;
binding3 = env0_3;
r0 = binding2 != null && binding3 != null;
r0 = r0 && a0[binding2] != null;
r0 = r0 && a0[binding2].channel === binding;
r0 = r0 && a0[binding3] != null;
if (r0) {
value7 = environment.__proto__;
defaultImport = importDefault(11879) /* metro dependency 11879: DragAndDropUtils */;
r0 = defaultImport.moveItemFromTo(a0, env0_2, env0_3);
} else {
items = [];
arraySpread(items, a0, 0, a0);
r0 = items;
}
}
binding = env0_4;
const concat = binding.concat;
const defaultImport2 = importDefault(11879) /* metro dependency 11879: DragAndDropUtils */;
env0_4 = Reflect.apply(concat, binding, [defaultImport2.calculatePositionDeltas({oldOrdering: a0, newOrdering: r0,
idGetter: function(a0) {
return a0.channel.id;
}, existingPositionGetter: function(a0) {
return a0.channel.position;
}})]);
return r0;
}
function _fun122966({channel}) { // fn#122966, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16144:3762, offset: 0x0257c88e, size: 29 bytes, params: 2, frame: 11
return isGuildSelectableChannelType(channel.type);
}
function _fun122967({channel}) { // fn#122967, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16144:3931, offset: 0x0257c8ab, size: 20 bytes, params: 2, frame: 9
return channel.isGuildVocal();
}
function _fun122968(a0) { // fn#122968, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16144:4074, offset: 0x0257c8bf, size: 41 bytes, params: 2, frame: 4
var r0;
const value2 = a0.id === env0_0.id;
if (value2) {
a0.parent_id = importDefault;
r0 = true;
} else {
r0 = value2;
}
return r0;
}
+666
View File
@@ -0,0 +1,666 @@
/* Metro module 4800; source: utils/ChannelUtils.tsx; dependencies: [1383, 1379, 1935, 3784, 1934, 4300, 661, 1880, 3789, 483, 1909, 4801, 4802, 1244, 3995, 4803, 21, 2, 4806] */
function _fun41574(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#41574, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:6, offset: 0x01121f4e, size: 646 bytes, params: 8, frame: 23
const env0_0 = require;
const _arrayLikeToArray_41577 = 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 = allowChannelAccess;
const closure2 = function({channels, selectedChannelId, selectedVoiceChannelId, voiceStates}) {
channels.forEach(_fun41581);
return [];
};
const closure3 = getChannelPermalink;
const closure4 = getChannelThreadPermalink;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = require(1383) /* metro dependency 1383: ChannelRecord */;
const env0_4 = value.isGuildSelectableChannelType;
const env0_5 = value.TEXT_CHANNEL_TYPES;
const env0_6 = value.THREAD_CHANNEL_TYPES;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const guildChannelStore = importDefault(1935) /* metro dependency 1935: GuildChannelStore */;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
const sortedVoiceStateStore = importDefault(4300) /* metro dependency 4300: SortedVoiceStateStore */;
value = require(661) /* metro dependency 661: Constants */;
const ChannelTypes = value.ChannelTypes;
const env0_13 = value.Permissions;
const env0_14 = value.GuildFeatures;
const env0_15 = value.BoostedGuildTiers;
const env0_16 = value.BITRATE_MAX;
const env0_17 = value.BITRATE_DEFAULT;
const env0_18 = value.Routes;
const env0_19 = value.AnalyticsPages;
const env0_20 = (require(1880) /* metro dependency 1880: PremiumConstants */).BoostedGuildFeatures;
const env0_21 = ChannelTypes.GUILD_VOICE;
const env0_22 = ChannelTypes.GUILD_CATEGORY;
const env0_23 = ChannelTypes.GUILD_STAGE_VOICE;
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/ChannelUtils.tsx');
exports.denyChannelAccessForNonPaidUsers = denyChannelAccessForNonPaidUsers;
exports.allowChannelAccess = closure;
exports.permissionOverwritesForRoles = permissionOverwritesForRoles;
exports.permissionOverwriteForUser = function(a0, a1) {
var allowChannelAccessBinding = allowChannelAccess;
var MEMBER = require(dependencyMap[10]).PermissionOverwriteType.MEMBER;
return allowChannelAccessBinding(a0, a1, MEMBER);
};
exports.permissionOverwriteForRole = function(a0, a1) {
var allowChannelAccessBinding = allowChannelAccess;
var ROLE = require(dependencyMap[10]).PermissionOverwriteType.ROLE;
return allowChannelAccessBinding(a0, a1, ROLE);
};
exports.permissionOverwritesForAnnouncement = function(a0) {
var object = {id: a0};
object.type = require(dependencyMap[10]).PermissionOverwriteType.ROLE;
object.deny = Permissions.SEND_MESSAGES;
object.allow = importAll(dependencyMap[8]).NONE;
return [object];
};
exports.isChannelFull = isChannelFull;
exports.sanitizeGuildTextChannelName = importDefault(4806) /* metro dependency 4806: sanitizeGuildTextChannelName */;
exports.getBitrateLimit = getBitrateLimit;
exports.computeSummarizedVoiceStates = closure2;
exports.computeSummarizedVoiceUsers = computeSummarizedVoiceUsers;
exports.isAnyVoiceStateStage = isAnyVoiceStateStage;
exports.channelTypeString = channelTypeString;
exports.getPrivateChannelUserTagsString = getPrivateChannelUserTagsString;
exports.getMentionIconType = getMentionIconType;
exports.previousTextChannelRouteForGuild = function(a0) {
var r2;
var value4;
var value2 = ChannelStore.getChannel(SelectedChannelStore.getLastSelectedChannelId());
var value3 = null;
if (value3 == value2) {
value4 = GuildChannelStore.getDefaultChannel(a0);
r2 = value3 != value4 ? value4.id : value3;
} else if (value2.getGuildId() !== a0) {
value4 = GuildChannelStore.getDefaultChannel(a0);
r2 = value3 != value4 ? value4.id : value3;
} else if (value2.type === ChannelTypes.GUILD_TEXT) {
r2 = value2.id;
} else {
value4 = GuildChannelStore.getDefaultChannel(a0);
r2 = value3 != value4 ? value4.id : value3;
}
return Routes.CHANNEL(a0, r2);
};
exports.getChannelPermalink = closure3;
exports.getChannelThreadPermalink = closure4;
exports.getChannelLinkToCopy = getChannelLinkToCopy;
exports.getChannelAnalyticsPage = getChannelAnalyticsPage;
}
function _createForOfIteratorHelperLoose_41575(a0, a1) { // fn#41575, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:424, offset: 0x011221d4, 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 _fun41576;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_41577(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_41577(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_41577(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun41576;
}
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 isTypeOrCategory(a0, a1) { // fn#41578, offset: 0x01122346, size: 26 bytes, params: 3, frame: 3
return a0 === a1 || a0 === GUILD_CATEGORY;
}
function allowChannelAccess(a0, a1, a2) { // fn#41579, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:1446, offset: 0x01122360, size: 260 bytes, params: 4, frame: 20
var r10;
var moduleValue;
let NONE = (importAll(3789) /* metro dependency 3789: PermissionUtils */).NONE;
if (isGuildSelectableChannelType(a1) || a1 === GUILD_CATEGORY) {
moduleValue = importAll(483) /* metro dependency 483: BigFlagUtils */;
r10 = moduleValue.add(NONE, Permissions.VIEW_CHANNEL);
} else {
r10 = NONE;
}
const r1 = isTypeOrCategory(a1, GUILD_VOICE) || isTypeOrCategory(a1,
GUILD_STAGE_VOICE) ? (importAll(483) /* metro dependency 483: BigFlagUtils */).add((importAll(483) /* metro dependency 483: BigFlagUtils */).add(r10,
Permissions.VIEW_CHANNEL), Permissions.CONNECT) : r10;
NONE = (importAll(3789) /* metro dependency 3789: PermissionUtils */).NONE;
return {id: a0, type: a2, deny: NONE, allow: r1};
}
function computeSummarizedVoiceStates({channels, selectedChannelId, selectedVoiceChannelId, voiceStates}) { // fn#41580, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:1709, offset: 0x01122464, size: 66 bytes, params: 2, frame: 12
channels.forEach(_fun41581);
return [];
}
function getChannelPermalink(a0, a1, a2, a3) { // fn#41584, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:2079, offset: 0x01122576, size: 133 bytes, params: 5, frame: 22
const value = '';
return value + global.location.protocol + '//' + global.location.host + Routes.CHANNEL(a0, a1,
a2) + (a3 == null ? value : '?summaryId=' + a3);
}
function getChannelThreadPermalink(a0, a1, a2, a3) { // fn#41585, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:2222, offset: 0x011225fb, size: 135 bytes, params: 5, frame: 20
var r0;
var location;
var protocol;
var host;
var value;
if (a0 == null) {
r0 = getChannelPermalink(a0, a1, a3);
} else if (a1 == null) {
r0 = getChannelPermalink(a0, a1, a3);
} else if (a2 == null) {
r0 = getChannelPermalink(a0, a1, a3);
} else {
location = global.location;
protocol = location.protocol;
location = global.location;
host = location.host;
value = Routes.CHANNEL_THREAD_VIEW(a0, a1, a2, a3);
value = '' + protocol + '//' + host + value;
r0 = value;
}
return r0;
}
function denyChannelAccessForNonPaidUsers(a0, a1) { // fn#41586, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:2494, offset: 0x01122682, size: 201 bytes, params: 3, frame: 18
var NONE;
var moduleValue;
var value3;
var object2;
const GUILD_STAGE_VOICE = ChannelTypes.GUILD_STAGE_VOICE;
if (a1 === GUILD_STAGE_VOICE) {
NONE = (importAll(3789) /* metro dependency 3789: PermissionUtils */).NONE;
moduleValue = importAll(483) /* metro dependency 483: BigFlagUtils */;
value3 = moduleValue.add(NONE, Permissions.CONNECT);
object2 = {id: a0};
object2.type = (require(1909) /* metro dependency 1909: Server */).PermissionOverwriteType.ROLE;
NONE = (importAll(3789) /* metro dependency 3789: PermissionUtils */).NONE;
object2.allow = NONE;
object2.deny = value3;
return object2;
}
const Error = global.Error;
const value = 'Premium channel feature not supported for channel type ' + a1;
const value2 = Object.create(Error.prototype, {constructor: {value: Error}});
const error = new Error();
throw error instanceof Object ? error : value2;
}
function permissionOverwritesForRoles(a0, a1, a2) { // fn#41587, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:2855, offset: 0x0112274b, size: 342 bytes, params: 4, frame: 25
var r15;
var r5;
var push;
var ROLE;
var NONE;
var moduleValue;
var object2;
const value = a3;
const env0_0 = a1;
const r4 = value !== undefined ? value : false;
const items2 = [];
if (a2.length > 0 || r4) {
push = items2.push;
ROLE = (require(1909) /* metro dependency 1909: Server */).PermissionOverwriteType.ROLE;
NONE = (importAll(3789) /* metro dependency 3789: PermissionUtils */).NONE;
if (isGuildSelectableChannelType(a1) || a1 === GUILD_CATEGORY) {
moduleValue = importAll(483) /* metro dependency 483: BigFlagUtils */;
r15 = moduleValue.add(NONE, Permissions.VIEW_CHANNEL);
} else {
r15 = NONE;
}
r5 = isTypeOrCategory(a1,
GUILD_VOICE) ? (importAll(483) /* metro dependency 483: BigFlagUtils */).add((importAll(483) /* metro dependency 483: BigFlagUtils */).add(r15,
Permissions.VIEW_CHANNEL), Permissions.CONNECT) : r15;
object2 = {id: a0, type: ROLE};
NONE = (importAll(3789) /* metro dependency 3789: PermissionUtils */).NONE;
object2.allow = NONE;
object2.deny = r5;
Reflect.apply(push, items2, [object2]);
}
a2.forEach(_fun41588);
return items2;
}
function isChannelFull(a0, a1, a2) { // fn#41592, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:3810, offset: 0x011229c1, size: 366 bytes, params: 4, frame: 23
var r0;
var r6;
var r1;
let value = a0.getGuildId();
const guild = a2.getGuild(value);
const value3 = undefined;
const maxVideoChannelUsers = guild == null ? value3 : guild.maxVideoChannelUsers;
const value4 = -1;
const r12 = maxVideoChannelUsers ?? value4;
const r5 = (guild == null ? value3 : guild.maxStageVideoChannelUsers) ?? value4;
const value6 = SortedVoiceStateStore.countVoiceStatesForChannel(a0.id);
const voiceStatesForChannel = SortedVoiceStateStore.getVoiceStatesForChannel(a0);
const can = PermissionStore.can;
const MOVE_MEMBERS = Permissions.MOVE_MEMBERS;
const r2 = Reflect.apply(can, PermissionStore, [MOVE_MEMBERS, a0]) && PermissionStore.can(Permissions.CONNECT, a0);
if (a0.type === GUILD_STAGE_VOICE) {
value = value != null;
if (value) {
value = a1.hasVideo(a0.id);
if (value) {
r6 = value;
} else {
value = require(4801) /* metro dependency 4801: ChannelListUtils */;
value = value.hasStream(voiceStatesForChannel);
r6 = value;
}
r1 = r6;
} else {
r1 = value;
}
r1 = r1 && r5 > 0;
r1 = r1 && value6 >= r5;
r0 = r1;
} else {
value = value != null;
r0 = value && a1.hasVideo(a0.id);
r0 = r0 && r12 > 0;
if (r0) {
value = 0;
value = value6 >= r12 + (r2 ? 1 : value);
r0 = value;
}
}
const userLimit = a0.userLimit;
r0 = !r0 ? userLimit > 0 && value6 >= a0.userLimit && !r2 : r0;
return r0;
}
function getBitrateLimit(a0, a1) { // fn#41593, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:4350, offset: 0x01122b2f, size: 161 bytes, params: 3, frame: 16
return a1.isGuildStageVoice() ? BITRATE_DEFAULT : a0 == null ? BITRATE_MAX : global.Math.max(a0.features.has(GuildFeatures.VIP_REGIONS) ? BoostedGuildFeatures[BoostedGuildTiers.TIER_3].limits.bitrate : BITRATE_MAX,
BoostedGuildFeatures[a0.premiumTier].limits.bitrate);
}
function computeSummarizedVoiceUsers({channels, selectedChannelId, selectedVoiceChannelId, voiceStates}) { // fn#41594, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:4615, offset: 0x01122bd0, size: 82 bytes, params: 2, frame: 14
return computeSummarizedVoiceStates({channels: channels, selectedChannelId: selectedChannelId,
selectedVoiceChannelId: selectedVoiceChannelId, voiceStates: voiceStates}).map(function(a0) {
return a0.user;
});
}
function isAnyVoiceStateStage(a0, a1, a2) { // fn#41596, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:4876, offset: 0x01122c2c, size: 280 bytes, params: 4, frame: 29
var r4;
var r14;
var value4;
var id;
var property;
var isGuildStageVoice;
var value5;
var value6;
var value7;
var moduleValue;
var getAudienceRequestToSpeakState;
var voiceState;
var value8;
var RequestToSpeakStates;
var ON_STAGE;
var value9;
var value10;
const value2 = _createForOfIteratorHelperLoose_41575(a0);
const value3 = value2();
let done = value3.done;
if (!done) {
r4 = value3;
reducibleLoop1: while (true) {
value4 = r4.value;
id = value4.id;
if (id !== a1) {
id = value4.id;
property = a2[id];
reducibleJoin8: while (true) {
if (property == null) {
break reducibleJoin8;
}
isGuildStageVoice = value4.isGuildStageVoice;
if (!Reflect.apply(isGuildStageVoice, value4, [])) {
break reducibleJoin8;
}
value5 = _createForOfIteratorHelperLoose_41575(property);
value6 = value5();
done = value6.done;
if (done) {
break reducibleJoin8;
}
r14 = value6;
reducibleLoop5: while (true) {
value7 = r14.value;
moduleValue = require(4802) /* metro dependency 4802: useAudienceRequestToSpeakState */;
getAudienceRequestToSpeakState = moduleValue.getAudienceRequestToSpeakState;
voiceState = value7.voiceState;
value8 = Reflect.apply(getAudienceRequestToSpeakState, moduleValue, [voiceState]);
RequestToSpeakStates = (require(4802) /* metro dependency 4802: useAudienceRequestToSpeakState */).RequestToSpeakStates;
ON_STAGE = RequestToSpeakStates.ON_STAGE;
if (value8 === ON_STAGE) {
return true;
}
value9 = value5();
done = value9.done;
if (done) {
break reducibleJoin8;
}
r14 = value9;
continue reducibleLoop5;
}
}
}
value10 = value2();
done = value10.done;
if (done) {
return false;
}
r4 = value10;
continue reducibleLoop1;
}
}
return false;
}
function channelTypeString({type}) { // fn#41597, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:5270, offset: 0x01122d44, size: 783 bytes, params: 2, frame: 15
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const DM = ChannelTypes.DM;
if (DM === type) {
return intl.string(t.jN2DfZ);
}
const GROUP_DM = ChannelTypes.GROUP_DM;
if (GROUP_DM === type) {
return intl.string(t['e5y+gm']);
}
const GUILD_TEXT = ChannelTypes.GUILD_TEXT;
if (GUILD_TEXT === type) {
return intl.string(t.Pnajj0);
}
const GUILD_FORUM = ChannelTypes.GUILD_FORUM;
if (GUILD_FORUM === type) {
return intl.string(t.GbryDd);
}
const GUILD_MEDIA = ChannelTypes.GUILD_MEDIA;
if (GUILD_MEDIA === type) {
return intl.string(t.seKITE);
}
const GUILD_VOICE = ChannelTypes.GUILD_VOICE;
if (GUILD_VOICE === type) {
return intl.string(t.BVZqJl);
}
const GUILD_STAGE_VOICE = ChannelTypes.GUILD_STAGE_VOICE;
if (GUILD_STAGE_VOICE === type) {
return intl.string(t.EErMzA);
}
const GUILD_ANNOUNCEMENT = ChannelTypes.GUILD_ANNOUNCEMENT;
if (GUILD_ANNOUNCEMENT === type) {
return intl.string(t.l1dkSD);
}
const GUILD_STORE = ChannelTypes.GUILD_STORE;
if (GUILD_STORE === type) {
return intl.string(t['P1/Erq']);
}
const GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
if (GUILD_CATEGORY === type) {
return intl.string(t.vHCZwr);
}
return null;
}
function getPrivateChannelUserTagsString(a0, a1) { // fn#41598, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:6063, offset: 0x01123053, size: 298 bytes, params: 3, frame: 20
var r4;
var value5;
var user;
var value7;
if (a0 == null) {
return null;
}
const id = a1.getCurrentUser()?.id;
if (id == null) {
return null;
}
const items2 = [];
const value3 = _createForOfIteratorHelperLoose_41575(a0);
const value4 = value3();
let done = value4.done;
if (!done) {
r4 = value4;
while (true) {
value5 = r4.value;
if (id !== value5) {
user = a1.getUser(value5);
if (user == null) {
break;
}
items2.push(user);
break;
}
value7 = value3();
done = value7.done;
if (done) {
break;
}
r4 = value7;
continue;
}
}
if (items2.length === 0) {
return null;
}
const value9 = items2.slice(0, 2).map(_fun41599);
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const formatToPlainString = intl.formatToPlainString;
const BXG0Eh = (require(1244) /* metro dependency 1244: indexNative */).t.BXG0Eh;
return Reflect.apply(formatToPlainString, intl, [BXG0Eh, {users: items2.length, user1: value9[0], user2: value9[1],
extras: items2.length - value9.length}]);
}
function getMentionIconType(a0) { // fn#41600, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:6604, offset: 0x011231bc, size: 304 bytes, params: 2, frame: 16
if (a0 == null) {
return 'text';
}
const isMediaChannel = a0.isMediaChannel();
const type = a0.type;
const GUILD_VOICE = ChannelTypes.GUILD_VOICE;
return type === GUILD_VOICE ? PermissionStore.can(Permissions.CONNECT,
a0) ? 'voice' : 'voice-locked' : a0.type === ChannelTypes.GUILD_STAGE_VOICE ? PermissionStore.can(Permissions.CONNECT,
a0) ? 'stage' : 'stage-locked' : THREAD_CHANNEL_TYPES.has(a0.type) ? a0.isForumPost() ? 'post' : 'thread' : a0.type === ChannelTypes.GUILD_FORUM ? isMediaChannel ? 'media' : 'forum' : a0.type === ChannelTypes.GUILD_MEDIA ? 'media' : TEXT_CHANNEL_TYPES.has(a0.type) ? 'text' : undefined;
}
function getChannelLinkToCopy(a0, a1, a2, a3) { // fn#41602, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:7366, offset: 0x0112336b, size: 151 bytes, params: 5, frame: 21
var r0;
var id;
var getChannelThreadPermalinkBinding;
var id2;
let value = a3;
const guildId = a0.getGuildId();
if (a1 == null) {
r0 = value ?? getChannelPermalink(guildId, a0.id, a2);
} else if ((require(4803) /* metro dependency 4803: MediaPostEmbedUtils */).canUseMediaPostEmbed(guildId, a1)) {
getChannelThreadPermalinkBinding = getChannelThreadPermalink;
id = a1.id;
id2 = a0.id;
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
value = getChannelThreadPermalinkBinding(guildId, id, id2, value.castChannelIdAsMessageId(a0.id));
r0 = value;
} else {
r0 = value ?? getChannelPermalink(guildId, a0.id, a2);
}
return r0;
}
function getChannelAnalyticsPage(a0) { // fn#41603, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:7629, offset: 0x01123402, size: 129 bytes, params: 2, frame: 4
if (a0 != null) {
var type = a0.type;
var GUILD_ANNOUNCEMENT = ChannelTypes.GUILD_ANNOUNCEMENT;
if (GUILD_ANNOUNCEMENT === type) {
return AnalyticsPages.GUILD_CHANNEL;
}
var GUILD_TEXT = ChannelTypes.GUILD_TEXT;
if (GUILD_TEXT === type) {
return AnalyticsPages.GUILD_CHANNEL;
}
var GUILD_FORUM = ChannelTypes.GUILD_FORUM;
if (GUILD_FORUM === type) {
return AnalyticsPages.GUILD_CHANNEL;
}
var GUILD_MEDIA = ChannelTypes.GUILD_MEDIA;
if (GUILD_MEDIA === type) {
return AnalyticsPages.GUILD_CHANNEL;
}
var GROUP_DM = ChannelTypes.GROUP_DM;
if (GROUP_DM === type) {
return AnalyticsPages.DM_CHANNEL;
}
var DM = ChannelTypes.DM;
if (DM === type) {
return AnalyticsPages.DM_CHANNEL;
}
}
return null;
}
function _fun41581(a0) { // fn#41581, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:1847, offset: 0x011224a6, size: 97 bytes, params: 2, frame: 13
var property;
var forEach;
const id = a0.id;
var isGuildStageVoice;
if (id !== selectedVoiceChannelId) {
if (a0.id !== selectedChannelId) {
property = voiceStates[a0.id];
if (property != null) {
isGuildStageVoice = a0.isGuildStageVoice();
forEach = property.forEach;
if (isGuildStageVoice) {
Reflect.apply(forEach, property, [_fun41582]);
} else {
Reflect.apply(forEach, property, [_fun41583]);
}
}
}
}
}
function _fun41588(a0) { // fn#41588, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:3238, offset: 0x011228a1, size: 74 bytes, params: 2, frame: 17
const binding = env0_1;
const push = binding.push;
const allowChannelAccessBinding = allowChannelAccess;
const PermissionOverwriteType = (require(1909) /* metro dependency 1909: Server */).PermissionOverwriteType;
const ROLE = PermissionOverwriteType.ROLE;
Reflect.apply(push, binding, [allowChannelAccessBinding(a0, require, ROLE)]);
}
function _fun41599(a0) { // fn#41599, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:6391, offset: 0x0112317d, size: 63 bytes, params: 2, frame: 13
var r0;
const isProvisional = a0.isProvisional;
let value = environment.__proto__;
value = importDefault(3995) /* metro dependency 3995: UserUtils */;
if (isProvisional) {
value = value.getName(a0);
r0 = value;
} else {
value = value.getUserTag(a0);
r0 = value;
}
return r0;
}
function _fun41582(a0) { // fn#41582, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:1931, offset: 0x01122507, size: 89 bytes, params: 2, frame: 16
let value = environment.__proto__.__proto__;
const getAudienceRequestToSpeakState = (require(4802) /* metro dependency 4802: useAudienceRequestToSpeakState */).getAudienceRequestToSpeakState;
value = Reflect.apply(getAudienceRequestToSpeakState, value, [a0.voiceState]);
const RequestToSpeakStates = (require(4802) /* metro dependency 4802: useAudienceRequestToSpeakState */).RequestToSpeakStates;
const ON_STAGE = RequestToSpeakStates.ON_STAGE;
if (value === ON_STAGE) {
value = environment.__proto__;
env1_3.push(a0);
}
}
function _fun41583(a0) { // fn#41583, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4978:2057, offset: 0x01122560, size: 22 bytes, params: 2, frame: 11
return env1_3.push(a0);
}
+68
View File
@@ -0,0 +1,68 @@
/* Metro module 11012; source: utils/ChatRestrictions.tsx; dependencies: [661, 11013, 1244, 2] */
function _fun84369(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84369, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11198:6, offset: 0x01f47364, size: 184 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = (require(661) /* metro dependency 661: Constants */).TOKEN_REGEX;
const items2 = [{check: check, analyticsType: '@Everyone Warning', animation: undefined}];
items2[1] = {check: function(a0) {
var r0;
var object;
var value2 = TOKEN_REGEX.test(a0);
if (value2) {
object = {};
object.body = require(dependencyMap[2]).intl.string(require(dependencyMap[2]).t.sTwS1a);
r0 = object;
} else {
r0 = !!value2;
}
return r0;
}, analyticsType: 'API Token Warning'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/ChatRestrictions.tsx');
exports.RESTRICTIONS = items2;
}
function check(a0, a1, a2) { // fn#84370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11198:122, offset: 0x01f4741c, size: 464 bytes, params: 4, frame: 22
var r8;
var value2;
var defaultImport2;
var value3;
var Math;
var pow;
var Math2;
var floor;
var Math3;
var value5;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var formatToPlainString;
var object;
if (a2) {
if (a1.getGuildId() == null) {
return false;
}
value2 = (importDefault(11013) /* metro dependency 11013: MentionGuardUtils */).extractEveryoneRole(a0, a1);
if (value2 == null) {
return false;
}
defaultImport2 = importDefault(11013) /* metro dependency 11013: MentionGuardUtils */;
if (defaultImport2.shouldShowEveryoneGuard(value2, a1)) {
value3 = (importDefault(11013) /* metro dependency 11013: MentionGuardUtils */).everyoneMemberCount(value2,
a1);
Math = global.Math;
pow = Math.pow;
Math2 = global.Math;
floor = Math2.floor;
Math3 = global.Math;
value5 = Reflect.apply(pow, Math, [10, Reflect.apply(floor, Math2, [Math3.log10(value3)])]);
r8 = a1.isForumPost() ? t.sYW2cy : a1.isThread() ? t['2YaiQ1'] : t['47E5Rz'];
formatToPlainString = intl.formatToPlainString;
object = {role: value2};
Math = global.Math;
object.count = (Math.trunc(value3 / value5) * value5).toLocaleString();
return {body: Reflect.apply(formatToPlainString, intl, [r8, object]), footer: intl.string(t.mVyrtu)};
}
}
return false;
}
+33
View File
@@ -0,0 +1,33 @@
/* Metro module 6797; source: utils/ClipboardUtils.native.tsx; dependencies: [5, 6798, 2] */
function _fun53500(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#53500, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6975:6, offset: 0x0134dcbd, size: 140 bytes, params: 8, frame: 19
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(5) /* metro dependency 5 */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/ClipboardUtils.native.tsx');
exports.SUPPORTS_COPY = true;
exports.copy = function() {
return _copy.apply(this, arguments);
};
exports.getString = getString_53505;
}
function _copy() { // fn#53501, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6975:106, offset: 0x0134dd49, size: 48 bytes, params: 1, frame: 14
return env0_2(_fun53503).apply(this, arguments);
}
function getString_53505() { // fn#53505, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6975:393, offset: 0x0134dde1, size: 37 bytes, params: 1, frame: 11
return (importDefault(6798) /* metro dependency 6798 */).getString();
}
function* _fun53503(a0, a1) { // fn#53503, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6975:139, offset: 0x0134dd82, size: 95 bytes, params: 3, frame: 14
if (true) {
value = environment.__proto__.__proto__;
env2_0(env2_1[1]).setString(a0);
if (a1 != null) {
a1();
}
var Promise = global.Promise;
yield Promise.resolve();
}
}
+253
View File
@@ -0,0 +1,253 @@
/* Metro module 4001; source: utils/Color.tsx; dependencies: [57, 6, 7, 2] */
function _fun32928(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#32928, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4159:6, offset: 0x01021fea, size: 191 bytes, params: 8, frame: 19
const closure = hslToRgb_32929;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = importDefault(57) /* metro dependency 57 */;
const env0_1 = importDefault(6) /* metro dependency 6 */;
const env0_2 = importDefault(7) /* metro dependency 7 */;
const env0_3 = RegExp('^#[0-9a-f]{3,8}$', 'i');
const env0_4 = RegExp('^((?:rgb|hsl)a?)\\s*\\(([^)]*)\\)', 'i');
const value = _fun32931();
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/Color.tsx');
exports.default = value;
exports.hslToRgb = closure;
}
function hslToRgb_32929({hue, saturation, lightness, alpha}) { // fn#32929, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4159:129, offset: 0x010220a9, size: 357 bytes, params: 2, frame: 19
let value = saturation / 255;
const value2 = lightness / 255;
let Math = global.Math;
value = (1 - Math.abs(2 * value2 - 1)) * value;
Math = global.Math;
const value3 = value * (1 - Math.abs(hue / 60 % 2 - 1));
const env0_0 = value2 - value / 2;
value = (hue < 60 ? [value, value3, 0] : hue < 120 ? [value3, value, 0] : hue < 180 ? [0, value,
value3] : hue < 240 ? [0, value3, value] : hue < 300 ? [value3, 0, value] : [value, 0, value3]).map(_fun32930);
return {red: value[0], green: value[1], blue: value[2], alpha: alpha};
}
function _fun32931() { // fn#32931, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4159:489, offset: 0x01022237, size: 206 bytes, params: 1, frame: 17
return env0_2(Color, [{key: 'toHexString', value: value_32933}, {key: 'toHSL', value: value_32934},
{key: 'getRelativeLuminance', value: value_32935}], [{key: 'parseString', value: value_32936},
{key: 'parseRgbString', value: function(a0) {
return a0 === 'transparent' ? new Color(0, 0, 0, 0) : this.parseColorFnString(a0);
}}, {key: 'parseHexString', value: value_32938}, {key: 'parseColorFnString', value: value_32939}]);
}
function _fun32930(a0) { // fn#32930, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4159:352, offset: 0x0102220e, size: 41 bytes, params: 2, frame: 12
const Math = global.Math;
return Math.round(255 * (a0 + env0_0));
}
function Color(a0, a1, a2, a3) { // fn#32932, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4159:500, offset: 0x01022305, size: 63 bytes, params: 5, frame: 13
env1_1(this, Color);
this.red = a0;
this.green = a1;
this.blue = a2;
this.alpha = a3;
}
function value_32933() { // fn#32933, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4159:628, offset: 0x01022344, size: 201 bytes, params: 1, frame: 15
let Math = global.Math;
let value = Math.round(this.red);
value = value.toString(16);
Math = global.Math;
const value3 = Math.round(this.green).toString(16);
Math = global.Math;
const value5 = Math.round(this.blue).toString(16);
value = '#' + (this.red > 15.5 ? value : '0' + value);
value += this.green > 15.5 ? value3 : '0' + value3;
return value + (this.blue > 15.5 ? value5 : '0' + value5);
}
function value_32934() { // fn#32934, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4159:860, offset: 0x0102240d, size: 307 bytes, params: 1, frame: 24
const object2 = {};
let red = this.red;
object2.red = red;
let green = this.green;
object2.green = green;
let blue = this.blue;
object2.blue = blue;
let alpha = this.alpha;
object2.alpha = alpha;
red = object2.red;
green = object2.green;
blue = object2.blue;
alpha = object2.alpha;
const value = red / 255;
const value2 = green / 255;
const value3 = blue / 255;
let Math = global.Math;
const value4 = Math.max(value, value2, value3);
Math = global.Math;
const value5 = Math.min(value, value2, value3);
const value6 = value4 - value5;
const value7 = (value4 + value5) / 2;
const value8 = 0;
const r4 = value6 > value8 ? value6 / (1 - global.Math.abs(2 * value7 - 1)) : value8;
return value8 === value6 ? {hue: value8, saturation: r4, lightness: value7,
alpha: alpha} : {hue: 60 * (value === value4 ? (value2 - value3) / value6 % 6 : value2 === value4 ? (value3 - value) / value6 + 2 : value3 !== value4 ? value8 : (value2 - value3) / value6 + 4), saturation: r4, lightness: value7, alpha: alpha};
}
function value_32935() { // fn#32935, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4159:1333, offset: 0x01022540, size: 332 bytes, params: 1, frame: 17
var r2;
let value = this.red / 255;
const value2 = this.green / 255;
const value3 = this.blue / 255;
if (value <= 0.03928) {
value /= 12.92;
r2 = value;
} else {
value = global.Math.pow((value + 0.055) / 1.055, 2.4);
r2 = value;
}
return 0.2126 * r2 + 0.7152 * (value2 <= 0.03928 ? value2 / 12.92 : global.Math.pow((value2 + 0.055) / 1.055,
2.4)) + 0.0722 * (value3 <= 0.03928 ? value3 / 12.92 : global.Math.pow((value3 + 0.055) / 1.055, 2.4));
}
function value_32936(a0) { // fn#32936, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4159:1596, offset: 0x0102268c, size: 82 bytes, params: 2, frame: 13
const match = a0.match;
const value = environment.__proto__;
return Reflect.apply(match, a0,
[env1_4]) != null ? this.parseColorFnString(a0) : a0.match(env1_3) != null ? this.parseHexString(a0) : undefined;
}
function value_32938(a0) { // fn#32938, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4159:1848, offset: 0x0102271e, size: 347 bytes, params: 2, frame: 23
var r2;
var r3;
var property;
var property2;
var property3;
var property4;
const match = a0.match;
let value = environment.__proto__;
if (Reflect.apply(match, a0, [env1_3]) == null) {
return undefined;
}
const items2 = [6, 8];
if (items2.includes(a0.length)) {
return undefined;
}
const value3 = a0.replace('#', '');
if (value3.length < 6) {
value = env1_0(value3, 4);
property = value[0];
property2 = value[1];
property3 = value[2];
property4 = value[3];
value = property + property + property2 + property2 + property3 + property3;
if (property4 == null) {
r2 = value;
} else {
value += property4 + property4;
r2 = value;
}
} else {
r2 = value3;
}
value = r2.match(RegExp('.{1,2}', 'g'));
if (value == null) {
return undefined;
}
let parseInt = global.parseInt;
const int = parseInt(value[0], 16);
parseInt = global.parseInt;
const value5 = 1;
const int2 = parseInt(value[value5], 16);
const int3 = global.parseInt(value[2], 16);
if (value[3] != null) {
value = global.parseInt(value[3], 16);
value /= 255;
r3 = value;
} else {
r3 = value5;
}
value = Object.create(Color.prototype, {constructor: {value: Color}});
const color = new Color(int, int2, int3);
return color instanceof Object ? color : value;
}
function value_32939(a0) { // fn#32939, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4159:2194, offset: 0x01022879, size: 342 bytes, params: 2, frame: 25
var environment;
var r1;
var value8;
var property3;
var property4;
var color;
var red;
var green;
var blue;
var alpha;
const match = a0.match;
let value = environment.__proto__;
const value3 = env1_0(Reflect.apply(match, a0, [env1_4]) ?? [], 3);
const value4 = 1;
let property = value3[value4];
const property2 = value3[2];
if (property != null) {
if (property2 != null) {
value8 = property2.split(RegExp('\\s*[,/\\s]\\s*', '')).map(function(a0) {
return a0.replace(',', '').trim();
}).filter(_fun32941).map(_fun32942);
if (property.substr(0, 3) === 'hsl') {
value = hslToRgb_32929({hue: value8[0], saturation: value8[value4], lightness: value8[2],
alpha: value8[3]});
red = value.red;
green = value.green;
blue = value.blue;
alpha = value.alpha;
value = Object.create(Color.prototype, {constructor: {value: Color}});
color = new Color();
return color instanceof Object ? color : value;
}
property = value8[0];
property3 = value8[value4];
property4 = value8[2];
r1 = typeof value8[3] !== 'number' ? value4 : value8[3];
value = Object.create(Color.prototype, {constructor: {value: Color}});
color = new Color(property);
return color instanceof Object ? color : value;
}
}
}
function _fun32942(a0, a1) { // fn#32942, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4159:2374, offset: 0x010229f1, size: 249 bytes, params: 3, frame: 13
var r1;
var r0;
var value;
const binding = env0_0;
let regexp = RegExp('%$', '');
if (regexp.test(a0)) {
if (a1 === 3) {
value = global.parseFloat(a0);
value /= 100;
r1 = value;
} else {
value = global.parseFloat(a0);
value = 255 * value / 100;
r1 = value;
}
r0 = r1;
} else if (binding[a1] !== 'h') {
r0 = global.parseFloat(a0);
} else {
regexp = RegExp('turn$', '');
if (regexp.test(a0)) {
value = global.parseFloat(a0);
value = 360 * value;
r0 = value;
} else {
regexp = RegExp('rad$', '');
if (regexp.test(a0)) {
value = global.parseFloat(a0);
value = 57.3 * value;
r0 = value;
} else {
r0 = global.parseFloat(a0);
}
}
}
return r0;
}
+711
View File
@@ -0,0 +1,711 @@
/* Metro module 4000; source: utils/ColorUtils.tsx; dependencies: [57, 674, 1244, 3, 4001, 2] */
function _fun32873(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#32873, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4158:6, offset: 0x0102042f, size: 738 bytes, params: 8, frame: 27
var object2;
let env0_0 = require;
let closure = hexToRgb;
const closure2 = hexToRgba;
const closure3 = rgbToHslObject;
const closure4 = function(a0, a1, a2) {
return 'hsl(' + a0 + ', ' + a1 + '%, ' + a2 + '%)';
};
const closure5 = function(a0, a1, a2) {
var env0_0 = a0;
var env0_1 = a2;
var closure = _fun32879;
var value = a2 / 100;
env0_1 = value;
var Math = global.Math;
value = Math.min(value, 1 - value);
var env0_2 = a1 * value / 100;
return '#' + closure(0) + closure(8) + closure(4);
};
const closure6 = hex2rgb2hsv;
const hslToRgb_32883 = function(a0, a1, a2) {
return hexToRgb(hslToHex(a0, a1, a2));
};
const closure7 = rawRgbToHsl;
const sortColors = function({hsv}, {hsv}) {
return hsv.s + hsv.v - (hsv.s + hsv.v);
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
object2 = {code: "function hexWithOpacity_ColorUtilsTsx1(color,value){if(color.length===7){const alpha=value*255|0;return color+alpha.toString(16).padStart(2,'0').toUpperCase();}const hex=color.charAt(0)==='#'?color.slice(1):color;let r;let g;let b;let a;switch(hex.length){case 3:r=hex.charAt(0);g=hex.charAt(1);b=hex.charAt(2);r+=r;g+=g;b+=b;a=(value*255|0).toString(16).padStart(2,'0').toUpperCase();return'#'+r+g+b+a;case 4:r=hex.charAt(0);g=hex.charAt(1);b=hex.charAt(2);a=hex.charAt(3);r+=r;g+=g;b+=b;a+=a;const alpha4=parseInt(a,16)/255*value;const alpha4Hex=(alpha4*255|0).toString(16).padStart(2,'0').toUpperCase();return'#'+r+g+b+alpha4Hex;case 6:const alpha6=(value*255|0).toString(16).padStart(2,'0').toUpperCase();return'#'+hex+alpha6;case 8:const baseColor='#'+hex.slice(0,6);const existingAlpha=parseInt(hex.slice(6),16)/255;const alpha8=(existingAlpha*value*255|0).toString(16).padStart(2,'0').toUpperCase();return baseColor+alpha8;default:throw new Error('Invalid hex color format');}}"};
let value = _fun32888();
object2 = {code: 'function hexToRgbaString_ColorUtilsTsx2(hex,opacity){const{hexToRgba}=this.__closure;const{r:r,g:g,b:b,a:a}=hexToRgba(hex);return"rgba("+r+", "+g+", "+b+", "+(opacity!==null&&opacity!==void 0?opacity:a)+")";}'};
let value2 = _fun32890();
object2 = {};
copyDataProperties(object2, {['#1abc9c']: function() {
return require(dependencyMap[2]).intl.string(require(dependencyMap[2]).t.fBawRj);
}, ['#2ecc71']: function() {
return require(dependencyMap[2]).intl.string(require(dependencyMap[2]).t.hvv3QR);
}, ['#3498db']: function() {
return require(dependencyMap[2]).intl.string(require(dependencyMap[2]).t.JwX6Jd);
}, ['#9b59b6']: function() {
return require(dependencyMap[2]).intl.string(require(dependencyMap[2]).t.H3xljj);
}, ['#e91e63']: function() {
return require(dependencyMap[2]).intl.string(require(dependencyMap[2]).t.X9izyR);
}, ['#11806a']: function() {
return require(dependencyMap[2]).intl.string(require(dependencyMap[2]).t.Kw7K2z);
}, ['#1f8b4c']: function() {
return require(dependencyMap[2]).intl.string(require(dependencyMap[2]).t.z5AZKW);
}, ['#206694']: function() {
return require(dependencyMap[2]).intl.string(require(dependencyMap[2]).t.JqBqKz);
}, ['#71368a']: function() {
return require(dependencyMap[2]).intl.string(require(dependencyMap[2]).t.edPgnK);
}, ['#ad1457']: function() {
return require(dependencyMap[2]).intl.string(require(dependencyMap[2]).t.ti7gsS);
}, ['#f1c40f']: function() {
return require(dependencyMap[2]).intl.string(require(dependencyMap[2]).t['H9jz+S']);
}, ['#e67e22']: function() {
return require(dependencyMap[2]).intl.string(require(dependencyMap[2]).t.UmsfHL);
}, ['#e74c3c']: function() {
return require(dependencyMap[2]).intl.string(require(dependencyMap[2]).t.GoDlAC);
}, ['#95a5a6']: function() {
return require(dependencyMap[2]).intl.string(require(dependencyMap[2]).t['9GpDYK']);
}, ['#607d8b']: function() {
return require(dependencyMap[2]).intl.string(require(dependencyMap[2]).t.lwrNQG);
}, ['#c27c0e']: function() {
return require(dependencyMap[2]).intl.string(require(dependencyMap[2]).t.Lf10GG);
}, ['#a84300']: function() {
return require(dependencyMap[2]).intl.string(require(dependencyMap[2]).t['H+AjY7']);
}, ['#992d22']: function() {
return require(dependencyMap[2]).intl.string(require(dependencyMap[2]).t.XTkdex);
}, ['#979c9f']: function() {
return require(dependencyMap[2]).intl.string(require(dependencyMap[2]).t.Ve0Lip);
}, ['#546e7a']: function() {
return require(dependencyMap[2]).intl.string(require(dependencyMap[2]).t.BwbOAO);
}, ['#99aab5']: function() {
return require(dependencyMap[2]).intl.string(require(dependencyMap[2]).t['/po5rJ']);
}}, undefined);
object2['#5865f2'] = function() {
return require(dependencyMap[2]).intl.string(require(dependencyMap[2]).t['Cn/LJ4']);
};
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/ColorUtils.tsx');
exports.hexWithOpacity = value;
exports.hexToRgb = closure;
exports.hexToRgbArray = hexToRgbArray;
exports.hexToRgba = closure2;
exports.hexToRgbaString = value2;
exports.hexOpacityToRgba = hexOpacityToRgba;
exports.rgbToHslObject = closure3;
exports.hslToString = closure4;
exports.rgbToHsl = function(a0, a1, a2) {
var value2 = rgbToHslObject(a0, a1, a2);
return hslToString(value2.h, value2.s, value2.l);
};
exports.rgbToHex = function(a0, a1, a2) {
var value = a0 << 16;
value = 16777216 + value + (a1 << 8) + a2;
value = value.toString(16);
value = value.slice(1);
return '#' + value;
};
exports.rgbaToHex = rgbaToHex;
exports.hslToHex = closure5;
exports.hexToColorName = hexToColorName;
exports.mixColors = mixColors;
exports.hex2rgb2hsv = closure6;
exports.getComplimentaryPaletteForColor = getComplimentaryPaletteForColor;
exports.rawRgbToHsl = closure7;
exports.getColorLightnessAdjusted = getColorLightnessAdjusted;
exports.getAccessibleForegroundColor = getAccessibleForegroundColor;
exports.findColorByHsv = function(a0) {
var value = a0.slice(0, 3);
value = value.map(_fun32925);
return value.sort(sortColors)[0].hex;
};
exports.getSaturatedColorHex = getSaturatedColorHex;
exports.interpolateColor = interpolateColor;
}
function hexToRgb(a0) { // fn#32874, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4158:1968, offset: 0x01020711, size: 90 bytes, params: 2, frame: 14
const value = env0_3((importDefault(674) /* metro dependency 674 */)(a0).rgb(), 3);
return {r: value[0], g: value[1], b: value[2]};
}
function hexToRgba(a0) { // fn#32875, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4158:2052, offset: 0x0102076b, size: 101 bytes, params: 2, frame: 14
const value = env0_3((importDefault(674) /* metro dependency 674 */)(a0).rgba(), 4);
return {r: value[0], g: value[1], b: value[2], a: value[3]};
}
function rgbToHslObject(a0, a1, a2) { // fn#32876, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4158:2654, offset: 0x010207d0, size: 287 bytes, params: 4, frame: 22
var r7;
let value = a0 / 255;
const value2 = a1 / 255;
const value3 = a2 / 255;
let Math = global.Math;
const value4 = Math.min(value, value2, value3);
Math = global.Math;
const value5 = Math.max(value, value2, value3);
const value6 = value5 - value4;
const value7 = 0;
const value8 = value7 === value6;
const r9 = value8 ? value7 : value5 === value ? (value2 - value3) / value6 % 6 : value5 === value2 ? (value3 - value) / value6 + 2 : (value - value2) / value6 + 4;
Math = global.Math;
value = Math.round(60 * r9);
if (value < value7) {
value += 360;
r7 = value;
} else {
r7 = value;
}
value = (value5 + value4) / 2;
const object2 = {h: r7};
const value10 = 100 * (value8 ? value7 : value6 / (1 - global.Math.abs(2 * value - 1)));
object2.s = Number(value10.toFixed(1));
value = 100 * value;
object2.l = Number(value.toFixed(1));
return object2;
}
function hslToHex(a0, a1, a2) { // fn#32878, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4158:3004, offset: 0x01020923, size: 122 bytes, params: 4, frame: 18
const env0_0 = a0;
const env0_1 = a2;
const closure = hslToHexF;
let value = a2 / 100;
const Math = global.Math;
value = Math.min(value, 1 - value);
const env0_2 = a1 * value / 100;
return '#' + closure(0) + closure(8) + closure(4);
}
function hex2rgb2hsv(a0) { // fn#32880, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4158:4480, offset: 0x01020a40, size: 358 bytes, params: 2, frame: 26
var r7;
var r6;
var r9;
var value7;
var value8;
var value9;
var value10;
const closure = hex2rgb2hsvDiffc;
const closure2 = function(a0) {
var Math = global.Math;
return Math.round(100 * a0) / 100;
};
let value = RegExp('^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$', 'i').exec(a0);
if (value == null) {
return null;
}
const value2 = global.parseInt(value[1], 16) / 255;
const value3 = global.parseInt(value[2], 16) / 255;
value = global.parseInt(value[3], 16) / 255;
let Math = global.Math;
const value4 = Math.max(value2, value3, value);
Math = global.Math;
const value5 = value4 - Math.min(value2, value3, value);
const value6 = 0;
if (value6 === value5) {
r6 = value6;
r9 = value6;
} else {
value7 = value5 / value4;
value8 = closure(value2);
value9 = closure(value3);
value10 = closure(value);
r7 = value2 === value4 ? value10 - value9 : value3 === value4 ? 0.3333333333333333 + value8 - value10 : value !== value4 ? value6 : 0.6666666666666666 + value9 - value8;
if (r7 < value6) {
value = r7 + 1;
r6 = value7;
r9 = value;
} else if (r7 > 1) {
value = r7 - 1;
r6 = value7;
r9 = value;
} else {
r6 = value7;
r9 = r7;
}
}
const object2 = {};
Math = global.Math;
object2.h = Math.round(360 * r9);
object2.s = closure2(100 * r6);
object2.v = closure2(100 * value4);
return object2;
}
function rawRgbToHsl(a0, a1, a2) { // fn#32884, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4158:5081, offset: 0x01020bf7, size: 248 bytes, params: 4, frame: 23
var r0;
var r5;
var r2;
var r4;
var value8;
let value = a0 / 255;
const value2 = a1 / 255;
const value3 = a2 / 255;
let Math = global.Math;
const value4 = Math.max(value, value2, value3);
Math = global.Math;
const value5 = Math.min(value, value2, value3);
const value6 = (value4 + value5) / 2;
const value7 = 0;
if (value4 === value5) {
r2 = value7;
r4 = value7;
} else {
value8 = value4 - value5;
r0 = value6 > 0.5 ? value8 / (2 - value4 - value5) : value8 / (value4 + value5);
if (value === value4) {
value = (value2 - value3) / value8;
value += value2 < value3 ? 6 : value7;
r5 = value;
} else if (value2 === value4) {
value = (value3 - value) / value8 + 2;
r5 = value;
} else if (value3 !== value4) {
r5 = undefined;
} else {
value = (value - value2) / value8 + 4;
r5 = value;
}
if (r5 == null) {
r2 = r0;
r4 = value7;
} else {
value = r5 / 6;
r2 = r0;
r4 = value;
}
}
return {hue: 360 * r4, saturation: r2, lightness: value6, alpha: 1};
}
function rawHslToRgb(a0, a1, a2) { // fn#32885, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4158:5394, offset: 0x01020cef, size: 250 bytes, params: 4, frame: 22
var r8;
var r2;
var r3;
var r6;
var closure;
var value6;
var value7;
let value = a2;
const value2 = a0 / 360;
if (a1 === 0) {
r2 = value;
r3 = value;
r6 = value;
} else {
closure = rawHslToRgbHue2rgb;
r8 = value < 0.5 ? value * (1 + a1) : value + a1 - value * a1;
value = 2 * value - r8;
value6 = closure(value, r8, value2 + 0.3333333333333333);
value7 = closure(value, r8, value2);
value = closure(value, r8, value2 - 0.3333333333333333);
r2 = value7;
r3 = value6;
r6 = value;
}
value = importDefault(4001) /* metro dependency 4001: Color */;
let Math = global.Math;
const value8 = Math.round(255 * r3);
Math = global.Math;
const value9 = Math.round(255 * r2);
Math = global.Math;
const value10 = Math.round(255 * r6);
const value11 = Object.create(value.prototype, {constructor: {value: value}});
value = new value(value8, value9, value10, 1);
return value instanceof Object ? value : value11;
}
function _fun32888() { // fn#32888, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4158:1111, offset: 0x01020ea5, size: 46 bytes, params: 1, frame: 2
const closure = hexWithOpacity;
closure.__closure = {};
closure.__workletHash = 1677228068105;
closure.__initData = env0_4;
return closure;
}
function _fun32890() { // fn#32890, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4158:2371, offset: 0x0102115b, size: 55 bytes, params: 1, frame: 4
const closure = function(a0, a1) {
var value = a1;
var value3 = hexToRgba(a0);
return 'rgba(' + value3.r + ', ' + value3.g + ', ' + value3.b + ', ' + (value ?? value3.a) + ')';
};
closure.__closure = {hexToRgba: hexToRgba};
closure.__workletHash = 8956046161224;
closure.__initData = env0_5;
return closure;
}
function hexToRgbArray(a0) { // fn#32914, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4158:5993, offset: 0x0102177e, size: 51 bytes, params: 2, frame: 11
const value = hexToRgb(a0);
return [value.r, value.g, value.b];
}
function hexOpacityToRgba(a0, a1) { // fn#32915, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4158:6119, offset: 0x010217b1, size: 82 bytes, params: 3, frame: 23
const value = hexToRgb(a0);
return 'rgba(' + value.r + ', ' + value.g + ', ' + value.b + ', ' + a1 + ')';
}
function rgbaToHex(a0, a1, a2, a3) { // fn#32918, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4158:6476, offset: 0x01021882, size: 142 bytes, params: 5, frame: 14
let value = 256 + a0;
value = value.toString(16);
value = value.slice(1);
value = '#' + value;
const value3 = (256 + a1).toString(16);
value += value3.slice(1);
const value5 = (256 + a2).toString(16);
value += value5.slice(1);
const value7 = (256 + a3).toString(16);
return value + value7.slice(1);
}
function hexToColorName(a0, a1) { // fn#32919, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4158:6672, offset: 0x01021910, size: 203 bytes, params: 3, frame: 18
var r1;
var r0;
var intl;
var value;
const property = env0_6[a0];
if (property == null) {
if (a1) {
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r1 = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['7BFCRR'],
{color: a0});
} else {
value = importDefault(3) /* metro dependency 3: Logger */;
value = new value('ColorUtils');
value.warn('Role color ' + a0 + ' has not been localized!');
value = 'undefined';
r1 = value;
}
r0 = r1;
} else {
r0 = property();
}
return r0;
}
function mixColors(a0, {red, green, blue, alpha}) { // fn#32920, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4158:6905, offset: 0x010219db, size: 179 bytes, params: 3, frame: 19
let alpha = a0.alpha;
let value = 1 - alpha;
value *= red;
value += alpha * a0.red;
const value4 = (1 - alpha) * green + alpha * a0.green;
const value7 = (1 - alpha) * blue + alpha * a0.blue;
alpha = a0.alpha;
const value8 = alpha + alpha * (1 - a0.alpha);
const defaultImport = importDefault(4001) /* metro dependency 4001: Color */;
const value10 = Object.create(defaultImport.prototype, {constructor: {value: defaultImport}});
value = new defaultImport(value, value4, value7, value8);
return value instanceof Object ? value : value10;
}
function getComplimentaryPaletteForColor(a0) { // fn#32921, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4158:7137, offset: 0x01021a8e, size: 221 bytes, params: 2, frame: 26
var r5;
var r11;
var value6;
var value7;
var value8;
var r;
var g;
var b;
const value = a1;
const r10 = value !== undefined ? value : 3;
const items2 = [];
const {h, s, l} = rgbToHslObject(a0[0], a0[1], a0[2]);
const r4 = s < 30 ? s + 30 : s;
const r2 = l > 80 ? l - 40 : l;
const r3 = r2 < 20 ? r2 + 15 : r2;
let length = items2.length;
if (length < r10) {
r5 = h;
while (true) {
value6 = r5 - 360 / (r10 + 1);
if (value6 < 0) {
value7 = value6 + 360;
r11 = value7;
} else {
r11 = value6;
}
value8 = hslToRgb_32883(r11, r4, r3);
r = value8.r;
g = value8.g;
b = value8.b;
items2.push([r, g, b]);
length = items2.length;
if (length < r10) {
r5 = r11;
continue;
}
break;
}
}
return items2;
}
function getColorLightnessAdjusted({red, green, blue}, a1) { // fn#32922, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4158:7451, offset: 0x01021b6b, size: 161 bytes, params: 3, frame: 18
const value = a2;
let r2 = value !== undefined ? value : false;
const value2 = rawRgbToHsl(red, green, blue);
const lightness = value2.lightness;
r2 = r2 ? lightness + a1 > 1 ? 0.9 : value2.lightness + a1 : lightness - a1 < 0 ? 0.1 : value2.lightness - a1;
value2.lightness = r2;
return rawHslToRgb(value2.hue, value2.saturation, value2.lightness);
}
function getAccessibleForegroundColor({foreground, background, ratio, saturationFactor}) { // fn#32923, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4158:7699, offset: 0x01021c0c, size: 339 bytes, params: 2, frame: 26
var r1;
var r3;
var r32;
var r9;
var r14;
var value;
var set;
var get;
var value2;
var value6;
var value7;
var value8;
var defaultImport2;
var value9;
var value10;
var alpha;
reducibleJoin2: while (true) {
if (ratio !== undefined) {
break reducibleJoin2;
}
value = 5;
ratio = value;
break reducibleJoin2;
}
reducibleJoin4: while (true) {
if (saturationFactor !== undefined) {
break reducibleJoin4;
}
value = 1;
saturationFactor = value;
break reducibleJoin4;
}
reducibleJoin6: while (true) {
if (saturationFactor < 1) {
set = foreground.set;
get = foreground.get;
value = Reflect.apply(set, foreground, ['hsl.s', Reflect.apply(get, foreground,
['hsl.s']) * saturationFactor]);
set = background.set;
get = background.get;
value2 = Reflect.apply(set, background, ['hsl.s', Reflect.apply(get, background,
['hsl.s']) * saturationFactor]);
r1 = value;
r3 = value2;
break reducibleJoin6;
}
r1 = foreground;
r3 = background;
break reducibleJoin6;
}
value = r3.luminance();
value = value <= 0.5;
const defaultImport = importDefault(674) /* metro dependency 674 */;
let contrast = defaultImport.contrast;
if (Reflect.apply(contrast, defaultImport, [r1, r3]) < ratio) {
r32 = r1;
r9 = 0;
reducibleLoop7: while (true) {
get = r32.get;
value6 = Reflect.apply(get, r32, ['hsl.l']);
if (value) {
reducibleJoin12: while (true) {
reducibleJoin14: while (true) {
if (value6 < 0.95) {
set = r32.set;
value8 = Reflect.apply(set, r32, ['hsl.l', value6 + 0.05]);
r14 = value8;
break reducibleJoin12;
}
r1 = r32;
break reducibleJoin14;
}
alpha = r1.alpha;
return Reflect.apply(alpha, r1, [1]);
}
} else {
reducibleJoin12: while (true) {
reducibleJoin14: while (true) {
if (value6 > 0.05) {
set = r32.set;
value7 = Reflect.apply(set, r32, ['hsl.l', value6 - 0.05]);
r14 = value7;
break reducibleJoin12;
}
r1 = r32;
break reducibleJoin14;
}
alpha = r1.alpha;
return Reflect.apply(alpha, r1, [1]);
}
}
defaultImport2 = defaultImport;
contrast = defaultImport2.contrast;
value9 = Reflect.apply(contrast, defaultImport2, [r14, r3]);
value10 = typeof r9 === 'bigint' ? r9 + 1n : +r9 + 1;
if (value10 < 10) {
if (value9 < ratio) {
r32 = r14;
r9 = value10;
continue reducibleLoop7;
}
r1 = r14;
break reducibleLoop7;
}
r1 = r14;
break reducibleLoop7;
}
}
return r1.alpha(1);
}
function findColorByHsv(a0) { // fn#32924, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4158:8121, offset: 0x01021d5f, size: 66 bytes, params: 2, frame: 13
let value = a0.slice(0, 3);
value = value.map(_fun32925);
return value.sort(sortColors)[0].hex;
}
function getSaturatedColorHex({colorRGB, saturationFactor}) { // fn#32926, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4158:8293, offset: 0x01021dd4, size: 179 bytes, params: 2, frame: 20
var r1;
var value8;
const value = undefined;
saturationFactor = saturationFactor === value ? 1 : saturationFactor;
if (colorRGB == null) {
return colorRGB;
}
const rawRgbToHslBinding = rawRgbToHsl;
let get = colorRGB.get;
const value4 = Reflect.apply(get, colorRGB, ['rgb.r']);
const value5 = colorRGB.get('rgb.g');
get = colorRGB.get;
const value6 = rawRgbToHslBinding(value4, value5, Reflect.apply(get, colorRGB, ['rgb.b']));
if (value6 == null) {
r1 = colorRGB == null ? value : colorRGB.hex();
} else {
value8 = rawHslToRgb(value6.hue, value6.saturation * saturationFactor, value6.lightness);
r1 = value8 == null ? value : value8.toHexString();
}
return r1;
}
function interpolateColor(a0, a1, a2) { // fn#32927, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4158:8581, offset: 0x01021e87, size: 355 bytes, params: 4, frame: 24
const parseInt = global.parseInt;
let value = a0.substring(1, 3);
value = parseInt(value, 16);
const int = global.parseInt(a0.substring(3, 5), 16);
const int2 = global.parseInt(a0.substring(5, 7), 16);
const int3 = global.parseInt(a1.substring(1, 3), 16);
const int4 = global.parseInt(a1.substring(3, 5), 16);
const int5 = global.parseInt(a1.substring(5, 7), 16);
let Math = global.Math;
value = Math.round(value + (int3 - value) * a2);
value = value.toString(16);
value = value.padStart(2, '0');
Math = global.Math;
const value4 = Math.round(int + (int4 - int) * a2).toString(16).padStart(2, '0');
Math = global.Math;
return '#' + value + value4 + Math.round(int2 + (int5 - int2) * a2).toString(16).padStart(2, '0');
}
function hslToHexF(a0) { // fn#32879, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4158:3064, owner: hslToHex.f, offset: 0x0102099d, size: 163 bytes, params: 2, frame: 20
const value2 = (a0 + env0_0 / 30) % 12;
const binding = env0_2;
let Math = global.Math;
const max = Math.max;
const Math2 = global.Math;
const min = Math2.min;
let value = value2 - 3;
value = Reflect.apply(min, Math2, [value, 9 - value2, 1]);
value = importDefault - binding * Reflect.apply(max, Math, [value, -1]);
Math = global.Math;
value = Math.round(255 * value);
value = value.toString(16);
return value.padStart(2, '0');
}
function hex2rgb2hsvDiffc(a0) { // fn#32881, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4158:4709, owner: hex2rgb2hsv.diffc, offset: 0x01020ba6, size: 45 bytes, params: 2, frame: 3
return (env0_0 - a0) / 6 / env0_1 + 0.5;
}
function rawHslToRgbHue2rgb(a0, a1, a2) { // fn#32886, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4158:5473, owner: rawHslToRgb.hue2rgb, offset: 0x01020de9, size: 136 bytes, params: 4, frame: 7
var r0;
let value = a0;
const value2 = a1;
const value3 = a2;
let r4 = value3 < 0 ? value3 + 1 : value3;
const r3 = r4 > 1 ? r4 - 1 : r4;
if (r3 < 0.16666666666666666) {
value += 6 * (value2 - value) * r3;
r0 = value;
} else if (r3 < 0.5) {
r0 = value2;
} else {
if (r3 < 0.6666666666666666) {
value += (value2 - value) * (0.6666666666666666 - r3) * 6;
r4 = value;
} else {
r4 = value;
}
r0 = r4;
}
return r0;
}
function hexWithOpacity(a0, a1) { // fn#32889, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4158:1141, offset: 0x01020ed3, size: 648 bytes, params: 3, frame: 22
var r5;
var value6;
var value9;
var value10;
var value11;
var value12;
var value13;
var value20;
var value21;
var value30;
let value = a0;
let length = value.length;
if (length === 7) {
value30 = (255 * a1 | 0).toString(16).padStart(2, '0');
return value + value30.toUpperCase();
}
if (value.charAt(0) !== '#') {
r5 = value;
} else {
value = value.slice(1);
r5 = value;
}
length = r5.length;
if (length === 3) {
value = r5.charAt(0);
value20 = r5.charAt(1);
value21 = r5.charAt(2);
value += value;
return '#' + value + (value20 + value20) + (value21 + value21) + (255 * a1 | 0).toString(16).padStart(2,
'0').toUpperCase();
}
if (length === 4) {
value = r5.charAt(0);
value10 = r5.charAt(1);
value11 = r5.charAt(2);
value12 = r5.charAt(3);
value13 = value12 + value12;
value += value;
return '#' + value + (value10 + value10) + (value11 + value11) + (255 * (global.parseInt(value13,
16) / 255 * a1) | 0).toString(16).padStart(2, '0').toUpperCase();
}
if (length === 6) {
value = '#' + r5;
value9 = (255 * a1 | 0).toString(16).padStart(2, '0');
return value + value9.toUpperCase();
}
if (length === 8) {
value = '#' + r5.slice(0, 6);
value6 = (global.parseInt(r5.slice(6), 16) / 255 * a1 * 255 | 0).toString(16).padStart(2, '0');
return value + value6.toUpperCase();
}
const Error = global.Error;
throw new Error('Invalid hex color format');
}
function _fun32925(a0) { // fn#32925, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4158:8173, offset: 0x01021da1, size: 51 bytes, params: 2, frame: 12
const value = environment.__proto__;
return {hex: a0, hsv: hex2rgb2hsv(a0) ?? ({'h': 0, 's': 0, 'v': 0})};
}
+32
View File
@@ -0,0 +1,32 @@
/* Metro module 1239; source: utils/ComponentDispatchUtils.tsx; dependencies: [661, 1240, 3, 1241, 2] */
function _fun13906(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#13906, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1366:6, offset: 0x00df7a3e, size: 260 bytes, params: 8, frame: 20
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = (require(661) /* metro dependency 661: Constants */).ComponentActionsKeyed;
let value = importDefault(3) /* metro dependency 3: Logger */;
value = new value('ComponentDispatchUtils');
const ComponentDispatcher = (require(1241) /* metro dependency 1241: ComponentDispatchUtils */).ComponentDispatcher;
const componentDispatcher = new ComponentDispatcher({'maxListeners': 100, 'enableDevtools': false,
logger: {warn: warn_13907}, devtoolsReporter: devtoolsReporter});
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/ComponentDispatchUtils.tsx');
exports.ComponentDispatcher = ComponentDispatcher;
exports.ComponentDispatch = componentDispatcher;
}
function warn_13907(a0, a1) { // fn#13907, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1366:257, offset: 0x00df7b42, size: 58 bytes, params: 3, frame: 16
const value = copyRestArgs(1, undefined);
const binding = env0_3;
const warn = binding.warn;
const items2 = [a0];
arraySpread(items2, value, 1, a0);
return apply(warn, items2, binding, a0);
}
function devtoolsReporter(a0, a1, a2) { // fn#13908, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1366:300, offset: 0x00df7b7c, size: 140 bytes, params: 4, frame: 15
const value = a0;
const Object = global.Object;
(importAll(1240) /* metro dependency 1240: DevtoolsExtension */).reportEvent({type: 'ComponentDispatch',
description: Object.values(ComponentActionsKeyed).find(_fun13909) ?? value, data: {actionData: a1,
fullActionName: value}, durationMs: a2});
}
+40
View File
@@ -0,0 +1,40 @@
/* Metro module 7045; source: utils/ContextUtils.tsx; dependencies: [31, 33, 2] */
function _fun55945(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#55945, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7223:6, offset: 0x013b8f8e, size: 125 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = importAll(31) /* metro dependency 31 */;
const env0_1 = (require(33) /* metro dependency 33 */).jsx;
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/ContextUtils.tsx');
exports.default = createDefinedContext;
}
function createDefinedContext() { // fn#55946, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7223:186, offset: 0x013b900b, size: 58 bytes, params: 1, frame: 13
return [env0_0.createContext(undefined), createDefinedContextUseContext, function() {
var env0_0 = createDefinedContextUseContext();
return _fun55949;
}];
}
function createDefinedContextUseContext() { // fn#55947, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7223:248, owner: createDefinedContext.useContext, offset: 0x013b9045, size: 69 bytes, params: 1, frame: 11
let value = environment.__proto__;
value = env1_0.useContext(env0_0);
if (value == null) {
throw new global.Error('Context was used outside of defined provider.');
}
return value;
}
function _fun55948() { // fn#55948, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7223:397, offset: 0x013b908a, size: 26 bytes, params: 1, frame: 10
const env0_0 = createDefinedContextUseContext();
return _fun55949;
}
function _fun55949({children}) { // fn#55949, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7223:434, offset: 0x013b90a4, size: 55 bytes, params: 2, frame: 14
const Provider = env1_0.Provider;
return (
<Provider value={env0_0}>
{children}
</Provider>
);
}
@@ -0,0 +1,31 @@
/* Metro module 16132; source: utils/CreateInstantInviteUtils.tsx; dependencies: [1935, 3784, 661, 2] */
function _fun124571(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#124571, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16340:6, offset: 0x025bd848, size: 173 bytes, params: 8, frame: 19
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const guildChannelStoreModule = require(1935) /* metro dependency 1935: GuildChannelStore */;
const env0_0 = guildChannelStoreModule.GUILD_SELECTABLE_CHANNELS_KEY;
const env0_1 = guildChannelStoreModule.GUILD_VOCAL_CHANNELS_KEY;
const guildChannelStore = importDefault(1935) /* metro dependency 1935: GuildChannelStore */;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const env0_4 = (require(661) /* metro dependency 661: Constants */).Permissions;
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/CreateInstantInviteUtils.tsx');
exports.getInvitableChannelForGuild = function(a0) {
var r4;
var value2 = GuildChannelStore.getChannels(a0);
var property = value2[GUILD_SELECTABLE_CHANNELS_KEY];
var items = [];
arraySpread(items, value2[GUILD_VOCAL_CHANNELS_KEY], arraySpread(items, property, 0, r4), r4);
return items.find(_fun124573);
};
}
function getInvitableChannelForGuild(a0) { // fn#124572, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16340:309, offset: 0x025bd8f5, size: 79 bytes, params: 2, frame: 15
const channels = GuildChannelStore.getChannels(a0);
const property = channels[GUILD_SELECTABLE_CHANNELS_KEY];
const items2 = [];
arraySpread(items2, channels[GUILD_VOCAL_CHANNELS_KEY], arraySpread(items2, property, 0, undefined), undefined);
return items2.find(function({channel}) {
return PermissionStore.can(Permissions.CREATE_INSTANT_INVITE, channel);
});
}
@@ -0,0 +1,28 @@
/* Metro module 4488; source: utils/CrossPlatformNativeUtils.native.tsx; dependencies: [2] */
function _fun38244(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#38244, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4666:6, offset: 0x010bae1f, size: 202 bytes, params: 8, frame: 16
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/CrossPlatformNativeUtils.native.tsx');
exports.default = {clearNavigationHistory: function() {
}, flushDNSCache: function() {
}, flushCookies: function() {
var Promise = global.Promise;
return Promise.resolve();
}, setApplicationBackgroundColor: function() {
}, setZoomFactor: function() {
return false;
}, focus: function() {
}, submitLiveCrashReport: function() {
var Promise = global.Promise;
return Promise.resolve();
}, getPidFromDesktopSource: function() {
}, getAudioPid: function() {
}, generateSessionFromPid: function() {
return '';
}, getAppHardwareAccelerationEnabled: function() {
return true;
}, getDiscordIsElevated: function() {
return null;
}};
}
+409
View File
@@ -0,0 +1,409 @@
/* Metro module 3826; source: utils/DateUtils.tsx; dependencies: [1949, 3, 3827, 3829, 1314, 3843, 1244, 694, 3845, 3738, 2] */
function _fun31072(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#31072, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3965:6, offset: 0x00ff2798, size: 577 bytes, params: 8, frame: 27
const env0_0 = require;
const closure = function() {
var Object = global.Object;
};
const closure2 = syncHourCycleToIntlConfig;
const closure3 = differenceInCalendarDays_31076;
const closure4 = dateFormat;
const closure5 = dateStringToMoment;
const toMoment = function(a0) {
var r0;
var value = a0;
if (importDefault(dependencyMap[9]).isMoment(value)) {
r0 = value;
} else {
value = importDefault(dependencyMap[9])(value);
r0 = value;
}
return r0;
};
const toDate_31080 = function(a0) {
var r0;
var value = a0;
if (importDefault(dependencyMap[9]).isMoment(value)) {
value = value.toDate();
r0 = value;
} else {
r0 = value;
}
return r0;
};
const closure6 = function() {
var Date = global.Date;
var value2 = new Date();
value2 = value2.toLocaleString('en-US', {timeZone: 'America/New_York'});
Date = global.Date;
var value3 = Object.create(Date.prototype, {constructor: {value: Date}});
value2 = new Date(value2);
return value2 instanceof Object ? value2 : value3;
};
let Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const localeStore = importDefault(1949) /* metro dependency 1949: LocaleStore */;
const value4 = new (importDefault(3) /* metro dependency 3: Logger */)('DateUtils');
Object = global.Object;
localeStore.addChangeListener(closure);
(importDefault(3827) /* metro dependency 3827: onTimezoneChangeAndroid */)(closure);
(importDefault(694) /* metro dependency 694: Dispatcher */).subscribe('USER_SETTINGS_PROTO_UPDATE', closure2);
(importDefault(694) /* metro dependency 694: Dispatcher */).subscribe('CONNECTION_OPEN', closure2);
object = [{'key': 'days', 'millisecondsInUnit': 86400000}, {'key': 'hours', 'millisecondsInUnit': 3600000},
{'key': 'minutes', 'millisecondsInUnit': 60000}, {'key': 'seconds', 'millisecondsInUnit': 1000}];
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/DateUtils.tsx');
exports.differenceInCalendarDays = closure3;
exports.differenceInDays = differenceInDays_31082;
exports.isSameHourMoment = function(a0, a1) {
var r0;
var value = a0.toDate();
var value2 = a1.toDate();
var Math = global.Math;
var value5 = Math.abs(Number(value) - Number(value2)) <= 3600000;
if (value5) {
value = value.getHours();
value = value === value2.getHours();
r0 = value;
} else {
r0 = value5;
}
return r0;
};
exports.isSameDay = isSameDay_31084;
exports.isWithinInterval = function(a0, a1, a2) {
var Math = global.Math;
var value = a0.valueOf();
value = Math.abs(value - a1.valueOf());
return value < a2;
};
exports.dateFormat = closure4;
exports.calendarFormat = calendarFormat;
exports.calendarFormatCompact = calendarFormatCompact;
exports.dateStringToMoment = closure5;
exports.accessibilityLabelCalendarFormat = accessibilityLabelCalendarFormat;
exports.diffAsUnits = diffAsUnits;
exports.unitsAsStrings = unitsAsStrings;
exports.getESTDate = closure6;
exports.getMonthlyProgressPercentage = getMonthlyProgressPercentage;
exports.getDaysRemainingInMonth = getDaysRemainingInMonth;
exports.formatDateForDatetimeLocal = formatDateForDatetimeLocal;
}
function syncHourCycleToIntlConfig() { // fn#31074, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3965:212, offset: 0x00ff29f8, size: 317 bytes, params: 1, frame: 22
var r8;
var r6;
var r12;
var moduleValue;
var supportsSystemDateFormatter;
var value4;
var property;
var value7;
var value8;
var H12;
var H23;
var value9;
let TimestampHourCycle = (require(3829) /* metro dependency 3829: UserSettings */).TimestampHourCycle;
const setting = TimestampHourCycle.getSetting();
TimestampHourCycle = (require(1314) /* metro dependency 1314: preloaded_user_settings */).TimestampHourCycle;
const AUTO = TimestampHourCycle.AUTO;
const value3 = setting !== AUTO;
reducibleJoin2: while (true) {
if (value3) {
moduleValue = require(3843) /* metro dependency 3843: SystemDateFormatterNative */;
supportsSystemDateFormatter = moduleValue.supportsSystemDateFormatter;
value4 = Reflect.apply(supportsSystemDateFormatter, moduleValue, []);
r8 = value4;
break reducibleJoin2;
}
r8 = value3;
break reducibleJoin2;
}
const Object = global.Object;
const value5 = Object.values((require(1244) /* metro dependency 1244: indexNative */).intl.formatConfig.time);
let length = value5.length;
const value6 = 0;
if (value6 < length) {
r6 = value6;
reducibleLoop3: while (true) {
property = value5[r6];
value7 = property != null;
reducibleJoin5: while (true) {
if (value7) {
value8 = 'hour' in property;
r12 = value8;
break reducibleJoin5;
}
r12 = value7;
break reducibleJoin5;
}
reducibleJoin13: while (true) {
if (r12) {
if (r8) {
TimestampHourCycle = (require(1314) /* metro dependency 1314: preloaded_user_settings */).TimestampHourCycle;
H12 = TimestampHourCycle.H12;
if (setting === H12) {
property.hourCycle = 'h12';
break reducibleJoin13;
}
}
if (r8) {
TimestampHourCycle = (require(1314) /* metro dependency 1314: preloaded_user_settings */).TimestampHourCycle;
H23 = TimestampHourCycle.H23;
if (setting === H23) {
property.hourCycle = 'h23';
break reducibleJoin13;
}
}
delete property.hourCycle;
break reducibleJoin13;
}
break reducibleJoin13;
}
value9 = typeof r6 === 'bigint' ? r6 + 1n : +r6 + 1;
length = value5.length;
if (value9 < length) {
r6 = value9;
continue reducibleLoop3;
}
break reducibleLoop3;
}
}
}
function startOfDay_31075(a0) { // fn#31075, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3965:616, offset: 0x00ff2b35, size: 224 bytes, params: 2, frame: 15
var r4;
var binding;
var date;
const value = a0;
const value2 = a1;
const r1 = !(value2 !== undefined) || value2;
const value4 = typeof value;
let r2 = value4 === 'string' || value4 === 'number';
r2 = !r2 ? value instanceof global.Date : r2;
if (r2) {
r4 = value;
} else {
binding = env0_3;
binding.error('Invalid date given to startOfDay', {d: value});
r4 = new global.Date();
}
const Date = global.Date;
const time = new Date().getTime();
if (r1) {
r4 = time;
} else {
date = date.getTimezoneOffset();
date = time - 60000 * date;
r4 = date;
}
const Math = global.Math;
return Math.floor(r4 / env0_4) * env0_4;
}
function differenceInCalendarDays_31076(a0, a1) { // fn#31076, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3965:865, offset: 0x00ff2c15, size: 62 bytes, params: 3, frame: 17
const Math = global.Math;
const floor = Math.floor;
const startOfDay_31075Binding = startOfDay_31075;
return Reflect.apply(floor, Math, [(startOfDay_31075Binding(a0, false) - startOfDay_31075Binding(a1,
false)) / env0_4]);
}
function dateFormat(a0, a1, a2) { // fn#31077, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3965:961, offset: 0x00ff2c53, size: 179 bytes, params: 4, frame: 22
var r1;
var binding;
var value5;
let value = a2;
value = '' + toMoment(a0).locale() + ':' + a1 + ':' + (value ?? (require(3829) /* metro dependency 3829: UserSettings */).TimestampHourCycle.getSetting());
const property = env0_5[value];
if (property != null) {
r1 = property;
} else {
binding = env0_5;
value5 = (importDefault(3845) /* metro dependency 3845: makeDateFormatter */)(a1);
binding[value] = value5;
r1 = value5;
}
return r1(toDate_31080(a0));
}
function dateStringToMoment(a0) { // fn#31078, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3965:1136, offset: 0x00ff2d06, size: 83 bytes, params: 2, frame: 12
if (a0.length >= 200) {
throw new global.Error('Date string exceeds maximum length');
}
return (importDefault(3738) /* metro dependency 3738 */)(a0);
}
function differenceInDays_31082(a0, a1) { // fn#31082, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3965:1972, offset: 0x00ff2e2c, size: 43 bytes, params: 3, frame: 10
let getTime = a0.getTime;
let value = Reflect.apply(getTime, a0, []);
getTime = a1.getTime;
value -= Reflect.apply(getTime, a1, []);
return value / env0_4;
}
function isSameDay_31084(a0, a1) { // fn#31084, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3965:2189, offset: 0x00ff2eb5, size: 75 bytes, params: 3, frame: 14
var r0;
const Math = global.Math;
const abs = Math.abs;
let value = Number(a0);
value = Reflect.apply(abs, Math, [value - Number(a1)]);
value = value <= env0_4;
if (value) {
value = a0.getDate();
value = value === a1.getDate();
r0 = value;
} else {
r0 = value;
}
return r0;
}
function calendarFormat(a0) { // fn#31086, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3965:2404, offset: 0x00ff2f38, size: 223 bytes, params: 2, frame: 20
var value9;
const value = a1;
const r1 = value !== undefined ? value : false;
const value2 = (importDefault(3738) /* metro dependency 3738 */).localeData();
const value3 = (importDefault(3738) /* metro dependency 3738 */)();
const value5 = differenceInCalendarDays_31076(toDate_31080(a0), value3.toDate());
if (value5 < -1) {
return dateFormat(a0, 'L LT', a2);
}
if (value5 < 0) {
return dateFormat(a0, value2.calendar('lastDay', toMoment(a0), value3), a2);
}
if (value5 < 1) {
value9 = 'sameDay';
if (r1) {
return dateFormat(a0, 'LT', a2);
}
return dateFormat(a0, value2.calendar(value9, toMoment(a0), value3), a2);
}
return dateFormat(a0, value2.calendar(value5 < 2 ? 'nextDay' : 'sameElse', toMoment(a0), value3), a2);
}
function calendarFormatCompact(a0, a1) { // fn#31087, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3965:2753, offset: 0x00ff3017, size: 170 bytes, params: 3, frame: 20
var r0;
var r1;
var calendar;
var value;
const value2 = (importDefault(3738) /* metro dependency 3738 */).localeData();
const value3 = (importDefault(3738) /* metro dependency 3738 */)();
const value5 = differenceInCalendarDays_31076(toDate_31080(a0), value3.toDate());
const dateFormatBinding = dateFormat;
if (value5 === 0) {
r1 = 'LT';
} else {
if (value5 === -1) {
calendar = value2.calendar;
value = toMoment(a0);
value = Reflect.apply(calendar, value2, ['lastDay', value, value3]);
r0 = value;
} else {
r0 = value5 > -7 ? 'dddd' : 'L';
}
r1 = r0;
}
return dateFormatBinding(a0, r1, a1);
}
function accessibilityLabelCalendarFormat(a0) { // fn#31088, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3965:3048, offset: 0x00ff30c1, size: 218 bytes, params: 2, frame: 23
var r0;
var calendar;
var value;
const value2 = (importDefault(3738) /* metro dependency 3738 */).localeData();
const Date = global.Date;
const date = new Date();
const value5 = differenceInCalendarDays_31076(a0, date);
const dateFormatBinding = dateFormat;
const value6 = 'sameElse';
const r7 = value5 < -1 ? value6 : value5 < 0 ? 'lastDay' : value5 < 1 ? 'sameDay' : value5 < 2 ? 'nextDay' : value6;
if (value6 === r7) {
r0 = 'LLL';
} else {
calendar = value2.calendar;
value = (importDefault(3738) /* metro dependency 3738 */)(a0);
value = Reflect.apply(calendar, value2, [r7, value, (importDefault(3738) /* metro dependency 3738 */)(date)]);
r0 = value;
}
return dateFormatBinding(a0, r0);
}
function diffAsUnits(a0, a1) { // fn#31089, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3965:3332, offset: 0x00ff319b, size: 163 bytes, params: 3, frame: 16
var Number;
let value = a2;
const r2 = value !== undefined ? value : false;
var env0_1;
const object2 = {'days': 0, 'hours': 0, 'minutes': 0};
object2.seconds = r2 ? 1 : 0;
if (!(a0 > a1)) {
if (r2) {
Number = global.Number;
value = Number(a0);
value += 1200;
Number = global.Number;
if (value > Number(a1)) {
return object2;
}
Number = global.Number;
value = Number(a1);
Number = global.Number;
env0_1 = value - Number(a0);
env0_6.forEach(_fun31090);
return object2;
}
Number = global.Number;
value = Number(a1);
Number = global.Number;
env0_1 = value - Number(a0);
env0_6.forEach(_fun31090);
}
return object2;
}
function unitsAsStrings(a0, a1) { // fn#31091, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3965:3597, offset: 0x00ff328e, size: 261 bytes, params: 3, frame: 19
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
return a0.days > 0 ? intl.formatToPlainString(a1.days, {days: a0.days,
hours: a0.hours}) : a0.hours > 0 ? intl.formatToPlainString(a1.hours, {hours: a0.hours,
minutes: a0.minutes}) : intl.formatToPlainString(a1.minutes, {minutes: global.Math.max(1, a0.minutes)});
}
function getMonthlyProgressPercentage() { // fn#31092, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3965:3932, offset: 0x00ff3393, size: 103 bytes, params: 1, frame: 16
let value = getESTDate();
const Date = global.Date;
const date = new Date(value.getFullYear(), value.getMonth() + 1, 0);
let getDate = date.getDate;
const value7 = Reflect.apply(getDate, date, []);
getDate = value.getDate;
value = Reflect.apply(getDate, value, []) / value7;
return value * 100;
}
function getDaysRemainingInMonth() { // fn#31093, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3965:4098, offset: 0x00ff33fa, size: 96 bytes, params: 1, frame: 16
const eSTDate = getESTDate();
const Date = global.Date;
const date = new Date(eSTDate.getFullYear(), eSTDate.getMonth() + 1, 0);
let getDate = date.getDate;
const value7 = Reflect.apply(getDate, date, []);
getDate = eSTDate.getDate;
return value7 - Reflect.apply(getDate, eSTDate, []);
}
function formatDateForDatetimeLocal(a0) { // fn#31094, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3965:4254, offset: 0x00ff345a, size: 48 bytes, params: 2, frame: 12
var r0;
let value = '';
if (a0 == null) {
r0 = value;
} else {
value = dateStringToMoment(a0);
value = value.format('YYYY-MM-DDTHH:mm');
r0 = value;
}
return r0;
}
function _fun31090({key, millisecondsInUnit}) { // fn#31090, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3965:3510, offset: 0x00ff323e, size: 80 bytes, params: 2, frame: 15
const binding = env0_0;
const Math = global.Math;
binding[key] = Math.floor(env0_1 / millisecondsInUnit);
env0_1 = env0_1 - env0_0[key] * millisecondsInUnit;
}
+146
View File
@@ -0,0 +1,146 @@
/* Metro module 11879; source: utils/DragAndDropUtils.tsx; dependencies: [3, 22, 2] */
function _fun91135(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#91135, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12065:6, offset: 0x02053701, size: 197 bytes, params: 8, frame: 21
var object2;
const closure = calculatePositionDeltas;
const closure2 = function(a0, a1, a2) {
var property = a0[a1];
var items = [];
arraySpread(items, a0, 0, a1);
items.splice(a1, 1);
items.splice(a2, 0, property);
return items;
};
const closure3 = getPositionUpdates;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importDefault(3) /* metro dependency 3: Logger */;
value = new value('DragAndDropUtils');
object2 = {moveItemFromTo: closure2, calculatePositionDeltas: closure, getPositionUpdates: closure3};
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/DragAndDropUtils.tsx');
exports.default = object2;
exports.calculatePositionDeltas = closure;
exports.moveItemFromTo = closure2;
exports.getPositionUpdates = closure3;
}
function calculatePositionDeltas({oldOrdering, newOrdering, idGetter, existingPositionGetter, ascending}) { // fn#91136, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12065:135, offset: 0x020537c6, size: 341 bytes, params: 2, frame: 27
var r0;
var r7;
var r15;
var r13;
var value;
var value5;
var value6;
var value7;
var value8;
var value9;
var push;
var reverse;
reducibleJoin2: while (true) {
if (ascending !== undefined) {
break reducibleJoin2;
}
value = true;
ascending = value;
break reducibleJoin2;
}
const length = newOrdering.length;
if (oldOrdering.length !== length) {
env0_2.warn('Arrays are not of the same length!', oldOrdering, newOrdering);
return [];
}
value = oldOrdering.map(idGetter);
value = value.sort();
value = value.join(':');
const value4 = newOrdering.map(idGetter).sort().join(':');
if (value !== value4) {
env0_2.warn('Object IDs in the old ordering and the new ordering are not the same.', value, value4);
return [];
}
const object2 = {};
value = 0;
if (value < length) {
r0 = value;
reducibleLoop5: while (true) {
value5 = idGetter(oldOrdering[r0]);
object2[value5] = existingPositionGetter(oldOrdering[r0]);
value6 = typeof r0 === 'bigint' ? r0 + 1n : +r0 + 1;
if (value6 < length) {
r0 = value6;
continue reducibleLoop5;
}
break reducibleLoop5;
}
}
const items2 = [];
if (value < length) {
r7 = value;
reducibleLoop7: while (true) {
value = idGetter(newOrdering[r7]);
reducibleJoin9: while (true) {
if (ascending) {
r15 = r7;
break reducibleJoin9;
}
value7 = length - 1 - r7;
r15 = value7;
break reducibleJoin9;
}
value8 = object2[value] === r15;
reducibleJoin11: while (true) {
if (value8) {
value9 = existingPositionGetter(newOrdering[r7]) === r15;
r13 = value9;
break reducibleJoin11;
}
r13 = value8;
break reducibleJoin11;
}
reducibleJoin13: while (true) {
if (r13) {
break reducibleJoin13;
}
push = items2.push;
Reflect.apply(push, items2, [{id: value, position: r15}]);
break reducibleJoin13;
}
value = typeof r7 === 'bigint' ? r7 + 1n : +r7 + 1;
if (value < length) {
r7 = value;
continue reducibleLoop7;
}
break reducibleLoop7;
}
}
reducibleJoin16: while (true) {
if (ascending) {
break reducibleJoin16;
}
reverse = items2.reverse;
Reflect.apply(reverse, items2, []);
break reducibleJoin16;
}
return items2;
}
function getPositionUpdates({objectArray, fromPosition, toPosition, idGetter, existingPositionGetter, ascending}) { // fn#91138, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12065:762, offset: 0x02053958, size: 162 bytes, params: 2, frame: 21
var r7;
var value;
ascending = ascending === undefined || ascending;
const Array = global.Array;
if (Array.isArray(objectArray)) {
r7 = objectArray;
} else {
value = importDefault(22) /* metro dependency 22 */;
value = value.values(objectArray);
r7 = value;
}
const calculatePositionDeltasBinding = calculatePositionDeltas;
const object2 = {oldOrdering: r7};
object2.newOrdering = moveItemFromTo(r7, fromPosition, toPosition);
object2.idGetter = idGetter;
object2.existingPositionGetter = existingPositionGetter;
object2.ascending = ascending;
return calculatePositionDeltasBinding(object2);
}
+18
View File
@@ -0,0 +1,18 @@
/* Metro module 672; source: utils/Durations.tsx; dependencies: [2] */
function _fun8027(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#8027, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:722:6, offset: 0x00d32eb4, size: 176 bytes, params: 8, frame: 16
var object2;
let Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
object2 = {};
Object = global.Object;
object2.Millis = Object.freeze({'HALF_SECOND': 500, 'SECOND': 1000, 'MINUTE': 60000, 'HOUR': 3600000,
'DAY': 86400000, 'WEEK': 604800000, 'DAYS_30': 2592000000});
Object = global.Object;
object2.Seconds = Object.freeze({'SECOND': 1, 'MINUTE': 60, 'HOUR': 3600, 'DAY': 86400, 'WEEK': 604800,
'DAYS_30': 2592000});
Object = global.Object;
object2.Minutes = Object.freeze({'MINUTE': 1, 'HOUR': 60, 'DAY': 1440, 'WEEK': 10080, 'DAYS_30': 43200});
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/Durations.tsx');
exports.default = object2;
}
+435
View File
@@ -0,0 +1,435 @@
/* Metro module 4641; source: utils/EmbedUtils.tsx; dependencies: [661, 4642, 21, 1391, 22, 3738, 673, 4627, 2] */
function _fun39903(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#39903, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4819:6, offset: 0x010ef3cc, size: 474 bytes, params: 8, frame: 19
var RegExp;
let env0_0 = require;
const validateSize = function({width, height}) {
return width > 0 && height > 0;
};
const appendQueryParams = function(a0, a1) {
var env0_0 = a1;
var value2 = new global.URL(a0);
var env0_1 = value2;
global.Object.keys(a1).forEach(_fun39907);
return value2.toString();
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_3 = constantsModule.MessageEmbedMediaFlags;
const env0_4 = constantsModule.MessageEmbedTypes;
const env0_5 = constantsModule.Permissions;
const env0_6 = (require(4642) /* metro dependency 4642: EmbedConstants */).EMBED_TYPES_WITH_PARSEABLE_FIELDS;
const env0_7 = RegExp('sketchfab', 'i');
const env0_8 = RegExp('^https:\\/\\/sketchfab\\.com', 'i');
const env0_9 = RegExp('youtube|steam|imgur|vimeo|sketchfab|soundcloud|streamable|twitch|vid\\.me|twitter', 'i');
const env0_10 = RegExp('^https?:\\/\\/(?:canary\\.|ptb\\.|www\\.)?discord(?:app)?\\.com\\/channels\\/([0-9]+)\\/shop$',
'');
const env0_11 = RegExp('^https?:\\/\\/(?:canary\\.|ptb\\.|www\\.)?discord(?:app)?\\.com\\/channels\\/([0-9]+)\\/shop\\/([0-9]+)$',
'');
RegExp = global.RegExp;
const regExp = new RegExp('^https://(?:(?:canary\\.|ptb\\.)?discord(?:app)?.com|staging\\.discord\\.co)/shop');
const env0_13 = RegExp('^https?:\\/\\/(?:canary\\.|ptb\\.|www\\.)?discord(?:app)?\\.com\\/channels\\/([0-9]+)\\/game-shop\\/([0-9]+)\\/([0-9]+)',
'');
const env0_14 = RegExp('^https?:\\/\\/(?:canary\\.|ptb\\.|www\\.)?discord(?:app)?\\.com\\/game-shop\\/([0-9]+)\\/([0-9]+)',
'');
const env0_15 = RegExp('^https?:\\/\\/(?:canary\\.|ptb\\.|www\\.)?discord(?:app)?\\.com\\/shop\\?(?=.*tab=game-shops)(?=.*applicationId=[0-9]+)(?=.*skuId=[0-9]+)',
'');
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/EmbedUtils.tsx');
exports.sanitizeEmbed = sanitizeEmbed;
exports.mergeEmbedsOnURL = function(a0) {
var Map = global.Map;
var env0_0 = new Map();
a0.forEach(_fun39911);
return [];
};
exports.getEffectiveVideoProvider = function(a0, a1) {
var property;
var prototype;
var value;
var value2;
var error;
if (a0 !== 'YouTube') {
reducibleJoin20: while (true) {
if (a0 !== 'TikTok') {
reduciblePort19: while (true) {
exceptionLanding18: while (true) {
if (a1 == null) {
break reduciblePort19;
}
try {
property = global.URL;
} catch (error) {
break exceptionLanding18;
}
try {
prototype = property.prototype;
} catch (error) {
break exceptionLanding18;
}
try {
} catch (error) {
break exceptionLanding18;
}
try {
value2 = new property(a1);
} catch (error) {
break exceptionLanding18;
}
try {
value = value2 instanceof Object ? value2 : value;
} catch (error) {
break exceptionLanding18;
}
try {
property = value.hostname;
} catch (error) {
break exceptionLanding18;
}
try {
value = property === 'www.youtube.com';
} catch (error) {
break exceptionLanding18;
}
if (value) {
return 'YouTube';
}
try {
value = property === 'www.tiktok.com';
} catch (error) {
break exceptionLanding18;
}
if (value) {
return 'TikTok';
}
break reduciblePort19;
}
break reduciblePort19;
}
return a0;
}
break reducibleJoin20;
}
}
return a0;
};
exports.isEmbedInline = isEmbedInline;
exports.isServerShopArticleEmbed = isServerShopArticleEmbed;
exports.isCollectiblesShopArticleEmbed = isCollectiblesShopArticleEmbed;
exports.isSocialLayerStorefrontArticleEmbed = isSocialLayerStorefrontArticleEmbed;
exports.getMaxEmbedMediaSize = function(a0, a1, a2) {
return a1 == null ? a0.provider?.name === 'TikTok' ? {'maxMediaWidth': 400,
'maxMediaHeight': 450} : {'maxMediaWidth': 400, 'maxMediaHeight': 300} : a2 != null ? {maxMediaWidth: a1,
maxMediaHeight: a2} : a0.provider?.name === 'TikTok' ? {'maxMediaWidth': 400,
'maxMediaHeight': 450} : {'maxMediaWidth': 400, 'maxMediaHeight': 300};
};
exports.canEmbedLinks = canEmbedLinks;
exports.shouldStripEmbeds = function(a0) {
return a0.content !== '' || a0.messageSnapshots.some(_fun39920);
};
}
function sanitizeMedia({url, proxy_url, width, height, placeholder, placeholder_version, description, flags, content_type}) { // fn#39905, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4819:1031, offset: 0x010ef5c2, size: 186 bytes, params: 2, frame: 20
const object2 = {url: url, proxyURL: proxy_url, width: width, height: height, placeholder: placeholder,
placeholderVersion: placeholder_version, description: description};
const flagUtilsModule = require(1391) /* metro dependency 1391: FlagUtils */;
const hasFlag = flagUtilsModule.hasFlag;
const r7 = flags ?? 0;
const IS_ANIMATED = MessageEmbedMediaFlags.IS_ANIMATED;
object2.srcIsAnimated = Reflect.apply(hasFlag, flagUtilsModule, [r7, IS_ANIMATED]);
object2.flags = flags ?? 0;
object2.contentType = content_type ?? undefined;
return object2;
}
function appendQueryParams(a0, a1) { // fn#39906, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4819:1360, offset: 0x010ef67c, size: 86 bytes, params: 3, frame: 14
const env0_0 = a1;
const URL = global.URL;
const uRL = new URL(a0);
const Object = global.Object;
Object.keys(a1).forEach(_fun39907);
return uRL.toString();
}
function sanitizeEmbed(a0, a1, a2) { // fn#39908, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4819:1557, offset: 0x010ef6f9, size: 1205 bytes, params: 4, frame: 23
var r4;
var r10;
var r8;
var r7;
var r6;
var object6;
var object7;
var object8;
var defaultImport2;
var Date;
var value7;
var date;
var moduleValue;
var object9;
var appendQueryParamsBinding;
var binding;
var value20;
var regexp;
const object10 = {};
var value;
const value2 = undefined;
object10.id = (importDefault(22) /* metro dependency 22 */).uniqueId('embed_');
object10.url = a2.url;
let type = a2.type;
object10.type = type;
object10.rawTitle = a2.title;
object10.rawDescription = a2.description;
object10.referenceId = a2.reference_id;
object10.flags = a2.flags;
object10.contentScanVersion = a2.content_scan_version;
let footer = a2.footer;
if (footer != null) {
object6 = {};
footer = a2.footer;
object6.text = footer.text;
footer = a2.footer;
object6.iconURL = footer.icon_url;
footer = a2.footer;
object6.iconProxyURL = footer.proxy_icon_url;
object10.footer = object6;
}
let author = a2.author;
if (author != null && a2.author.name != null) {
object7 = {};
author = a2.author;
object7.name = author.name;
author = a2.author;
object7.url = author.url;
author = a2.author;
object7.iconURL = author.icon_url;
author = a2.author;
object7.iconProxyURL = author.proxy_icon_url;
object10.author = object7;
}
let provider = a2.provider;
if (provider != null && a2.provider.name != null) {
object8 = {};
provider = a2.provider;
object8.name = provider.name;
provider = a2.provider;
object8.url = provider.url;
object10.provider = object8;
}
let timestamp = a2.timestamp;
if (timestamp != null) {
defaultImport2 = importDefault(3738) /* metro dependency 3738 */;
Date = global.Date;
timestamp = a2.timestamp;
value7 = Object.create(Date.prototype, {constructor: {value: Date}});
date = new Date(timestamp);
object10.timestamp = defaultImport2(date instanceof Object ? date : value7);
}
if (a2.color != null) {
moduleValue = require(673) /* metro dependency 673: ColorUtils */;
object10.color = moduleValue.int2hsl(a2.color, false);
}
let thumbnail = a2.thumbnail;
if (thumbnail != null) {
if (validateSize(a2.thumbnail)) {
type = object10.type;
if (MessageEmbedTypes.ARTICLE === type) {
object10.image = sanitizeMedia(a2.thumbnail);
} else if (MessageEmbedTypes.IMAGE === type) {
object10.image = sanitizeMedia(a2.thumbnail);
} else {
object10.thumbnail = sanitizeMedia(a2.thumbnail);
}
}
}
if (a2.image != null && validateSize(a2.image)) {
object10.image = sanitizeMedia(a2.image);
}
let video = a2.video;
if (video != null) {
thumbnail = object10.thumbnail;
r4 = thumbnail == null && a2.video.proxy_url != null;
r4 = r4 && validateSize(a2.video);
if (r4) {
object9 = {};
video = a2.video;
object9.width = video.width;
video = a2.video;
object9.height = video.height;
appendQueryParamsBinding = appendQueryParams;
video = a2.video;
object9.url = appendQueryParamsBinding(video.proxy_url, {format: 'webp'});
object10.thumbnail = object9;
}
thumbnail = object10.thumbnail;
r4 = thumbnail != null && validateSize(a2.video);
if (r4) {
provider = a2.provider;
video = a2.video;
if (provider == null) {
binding = env0_8;
if (binding.test(video.url)) {
r6 = false;
} else {
value20 = video.proxy_url != null;
if (value20) {
r10 = value20;
} else {
regexp = RegExp('^https:', 'i');
r10 = regexp.test(video.url);
}
r8 = a1 != null && (importDefault(21) /* metro dependency 21: SnowflakeUtils */).extractTimestamp(a1) < 1492472454139;
if (r8) {
r8 = r10 && provider != null;
r8 = r8 && env0_9.test(provider.name);
r7 = r8;
} else {
r7 = r10;
}
r6 = r7;
}
} else {
binding = env0_7;
if (binding.test(provider.name)) {
r6 = false;
} else {
binding = env0_8;
if (binding.test(video.url)) {
r6 = false;
} else {
value20 = video.proxy_url != null;
if (value20) {
r10 = value20;
} else {
regexp = RegExp('^https:', 'i');
r10 = regexp.test(video.url);
}
r8 = a1 != null && (importDefault(21) /* metro dependency 21: SnowflakeUtils */).extractTimestamp(a1) < 1492472454139;
if (r8) {
r8 = r10 && provider != null;
r8 = r8 && env0_9.test(provider.name);
r7 = r8;
} else {
r7 = r10;
}
r6 = r7;
}
}
}
r4 = r6;
}
if (r4) {
object10.video = sanitizeMedia(a2.video);
}
}
if (EMBED_TYPES_WITH_PARSEABLE_FIELDS.has(object10.type)) {
object10.fields = (a2.fields ?? []).map(function({name, value, inline}) {
return {rawName: name, rawValue: value, inline: inline};
});
} else {
object10.fields = [];
}
if (a2.components != null) {
value = require(4627) /* metro dependency 4627: InteractionComponentUtils */;
value = value.transformComponents(a2.components);
object10.components = value.length > 0 ? value : value2;
}
return object10;
}
function mergeEmbedsOnURL(a0) { // fn#39910, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4819:3299, offset: 0x010efbd4, size: 62 bytes, params: 2, frame: 12
const Map = global.Map;
const map = new Map();
a0.forEach(_fun39911);
return [];
}
function isEmbedInline({image, video, type, author, rawTitle}) { // fn#39913, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4819:3846, offset: 0x010efd3b, size: 104 bytes, params: 2, frame: 8
var r2;
var r1;
var value2;
let r0 = image != null || video != null;
if (r0) {
value2 = type === MessageEmbedTypes.GIFV;
if (value2) {
r1 = value2;
} else {
r2 = type !== MessageEmbedTypes.RICH && author == null;
r2 = r2 && rawTitle == null;
r1 = r2;
}
r0 = r1;
}
return r0;
}
function isServerShopArticleEmbed(a0) { // fn#39914, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4819:4012, offset: 0x010efda3, size: 88 bytes, params: 2, frame: 14
const type = a0.type;
const ARTICLE = MessageEmbedTypes.ARTICLE;
return type === ARTICLE && a0.url != null && (env0_11.test(a0.url) || env0_10.test(a0.url));
}
function isCollectiblesShopArticleEmbed(a0) { // fn#39915, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4819:4154, offset: 0x010efdfb, size: 63 bytes, params: 2, frame: 13
const type = a0.type;
const ARTICLE = MessageEmbedTypes.ARTICLE;
return type === ARTICLE && a0.url != null && env0_12.test(a0.url);
}
function isSocialLayerStorefrontArticleEmbed(a0) { // fn#39916, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4819:4290, offset: 0x010efe3a, size: 110 bytes, params: 2, frame: 15
var r1;
var binding;
const type = a0.type;
const ARTICLE = MessageEmbedTypes.ARTICLE;
let r0 = type === ARTICLE && a0.url != null;
if (r0) {
binding = env0_14;
r1 = binding.test(a0.url) || env0_13.test(a0.url);
r1 = !r1 ? env0_15.test(a0.url) : r1;
r0 = r1;
}
return r0;
}
function canEmbedLinks(a0, a1) { // fn#39918, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4819:4693, offset: 0x010eff0a, size: 61 bytes, params: 3, frame: 13
return a0.isPrivate() ? !a0.isManaged() : a1.can(Permissions.EMBED_LINKS, a0);
}
function shouldStripEmbeds(a0) { // fn#39919, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4819:4801, offset: 0x010eff47, size: 45 bytes, params: 2, frame: 12
return a0.content !== '' || a0.messageSnapshots.some(function(a0) {
return a0.message.content !== '' || a0.message.attachments.length > 0;
});
}
function _fun39907(a0) { // fn#39907, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4819:1440, offset: 0x010ef6d2, size: 39 bytes, params: 2, frame: 13
env0_1.searchParams.set(a0, require[a0]);
}
function _fun39911(a0) { // fn#39911, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4819:3365, offset: 0x010efc12, size: 185 bytes, params: 2, frame: 15
var binding;
var value2;
var images;
if (a0.url != null) {
binding = env0_0;
value2 = binding.get(a0.url);
if (value2 == null) {
binding = env0_1;
binding.push(a0);
binding = env0_0;
binding.set(a0.url, a0);
return undefined;
}
if (a0.image != null) {
images = value2.images;
if (images == null) {
value2.images = [];
if (value2.image != null) {
images = value2.images;
images.push(value2.image);
}
}
images = value2.images;
images.push(a0.image);
}
} else {
env0_1.push(a0);
}
}
+750
View File
@@ -0,0 +1,750 @@
/* Metro module 3801; source: utils/EmojiUtils.tsx; dependencies: [5, 1383, 3784, 1878, 661, 1881, 3800, 3802, 6545, 3777, 7171, 1475, 1423, 2] */
function _fun29006(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#29006, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3928:6, offset: 0x00fb41c4, size: 738 bytes, params: 8, frame: 26
const env0_0 = require;
const _arrayLikeToArray_29009 = 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 = isCustomEmoji;
const closure2 = isInternalEmojiForGuildId;
const closure3 = getEmojiUnavailableReason;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
let value = require(1383) /* metro dependency 1383: ChannelRecord */;
const env0_4 = value.isGuildTextChannelType;
const env0_5 = value.isGuildVocalChannelType;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const env0_8 = (require(661) /* metro dependency 661: Constants */).Permissions;
value = require(1881) /* metro dependency 1881: EmojiConstants */;
const env0_9 = value.EMOJI_MAX_FILESIZE;
const env0_10 = value.EMOJI_MAX_LENGTH;
const env0_11 = value.EMOJI_RE;
const EmojiDisabledReasons = value.EmojiDisabledReasons;
const env0_13 = value.EmojiIntention;
const env0_14 = value.isExternalEmojiAllowedForIntention;
let Set = global.Set;
const PREMIUM_LOCKED = EmojiDisabledReasons.PREMIUM_LOCKED;
const ROLE_SUBSCRIPTION_LOCKED = EmojiDisabledReasons.ROLE_SUBSCRIPTION_LOCKED;
let set = new Set([PREMIUM_LOCKED, ROLE_SUBSCRIPTION_LOCKED]);
Set = global.Set;
object = [];
set = arraySpread(object, set, 0, 0);
let GUILD_SUBSCRIPTION_UNAVAILABLE = EmojiDisabledReasons.GUILD_SUBSCRIPTION_UNAVAILABLE;
object[set] = GUILD_SUBSCRIPTION_UNAVAILABLE;
set += 1;
const ROLE_SUBSCRIPTION_UNAVAILABLE = EmojiDisabledReasons.ROLE_SUBSCRIPTION_UNAVAILABLE;
object[set] = ROLE_SUBSCRIPTION_UNAVAILABLE;
set = new Set(object);
Set = global.Set;
const DISALLOW_CUSTOM = EmojiDisabledReasons.DISALLOW_CUSTOM;
const DISALLOW_EXTERNAL = EmojiDisabledReasons.DISALLOW_EXTERNAL;
GUILD_SUBSCRIPTION_UNAVAILABLE = EmojiDisabledReasons.GUILD_SUBSCRIPTION_UNAVAILABLE;
const ONLY_GUILD_EMOJIS_ALLOWED = EmojiDisabledReasons.ONLY_GUILD_EMOJIS_ALLOWED;
set = new Set([DISALLOW_CUSTOM, DISALLOW_EXTERNAL, GUILD_SUBSCRIPTION_UNAVAILABLE, ONLY_GUILD_EMOJIS_ALLOWED]);
object = {sanitizeEmojiName: sanitizeEmojiName};
object.filterUnsupportedEmojis = (importDefault(7171) /* metro dependency 7171: EmojiUtilsPlatformedNative */).filterUnsupportedEmojis;
const getURL = (importDefault(7171) /* metro dependency 7171: EmojiUtilsPlatformedNative */).getURL;
object.getURL = getURL;
object.isInternalEmojiForGuildId = closure2;
object.getEmojiUnavailableReason = closure3;
object.isCustomEmoji = closure;
object.getEmojiUnavailableReasons = getEmojiUnavailableReasons;
object.isEmojiFiltered = isEmojiFiltered;
object.isEmojiPremiumLocked = isEmojiPremiumLocked;
object.isEmojiCategoryNitroLocked = isEmojiCategoryNitroLocked;
object.isEmojiFilteredOrLocked = function(a0) {
return this.isEmojiFiltered(a0) || this.isEmojiPremiumLocked(a0);
};
object.isEmojiDisabled = isEmojiDisabled;
object.isFileTooBig = function(a0) {
return a0.size > 2097152;
};
object.isDataTooBig = function(a0) {
return require(dependencyMap[11]).dataUriFileSize(a0) > EMOJI_MAX_FILESIZE;
};
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/EmojiUtils.tsx');
exports.default = object;
exports.countEmoji = countEmoji;
exports.getEmojiColors = function() {
return _getEmojiColors.apply(this, arguments);
};
exports.getEmojiUrl = getEmojiUrl;
exports.getAllEmojiNamesString = function(a0) {
return 'allNamesString' in a0 ? a0.allNamesString : ':' + a0.name + ':';
};
}
function _createForOfIteratorHelperLoose_29007(a0, a1) { // fn#29007, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3928:370, offset: 0x00fb44a6, 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 _fun29008;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_29009(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_29009(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_29009(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun29008;
}
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 isCustomEmoji(a0) { // fn#29010, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3928:1536, offset: 0x00fb4618, size: 65 bytes, params: 2, frame: 13
const type = a0.type;
const EmojiTypes = (require(3800) /* metro dependency 3800: EmojiTypes */).EmojiTypes;
const GUILD = EmojiTypes.GUILD;
return type === GUILD || a0.guildId != null;
}
function isInternalEmojiForGuildId(a0, a1) { // fn#29011, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3928:1621, offset: 0x00fb4659, size: 56 bytes, params: 3, frame: 13
let value = a0 != null;
let r0 = value && a1 != null;
if (r0) {
value = isCustomEmoji(a0);
r0 = value ? a1 === a0.guildId : !value;
}
return r0;
}
function getEmojiUnavailableReason({emoji, channel, guildId, intention, forceIncludeExternalGuilds}) { // fn#29012, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3928:1721, offset: 0x00fb4691, size: 647 bytes, params: 2, frame: 23
var r1;
var r11;
var r8;
var r6;
var r4;
var PREMIUM_LOCKED;
var r5;
var DISALLOW_EXTERNAL;
var getGuildId;
var value2;
var value4;
var value5;
var isGuildTextChannelTypeBinding;
var type;
var isGuildTextChannelType2;
var value6;
var isGuildVocalChannelTypeBinding;
var isGuildVocalChannelType2;
var isInternalEmojiForGuildId2;
var can;
var USE_EXTERNAL_EMOJIS;
var value7;
var COMMUNITY_CONTENT;
var id;
var available;
var getCurrentUser;
var value8;
var defaultImport;
var canUseEmojisEverywhere;
var STATUS;
var managed;
var moduleValue;
var isUnusableRoleSubscriptionEmoji;
var animated;
var defaultImport2;
var canUseAnimatedEmojis;
var isPurchasableRoleSubscriptionEmoji;
var shouldHideGuildPurchaseEntryPoints;
var ROLE_SUBSCRIPTION_LOCKED;
var ROLE_SUBSCRIPTION_UNAVAILABLE;
let value = undefined;
reducibleJoin4: while (true) {
if (guildId !== value) {
r11 = guildId;
break reducibleJoin4;
}
reducibleJoin3: while (true) {
if (channel == null) {
r1 = value;
break reducibleJoin3;
}
getGuildId = channel.getGuildId;
value2 = Reflect.apply(getGuildId, channel, []);
r1 = value2;
break reducibleJoin3;
}
r11 = r1;
break reducibleJoin4;
}
if (isCustomEmoji(emoji)) {
if (intention !== EmojiIntention.GUILD_PROFILE) {
reducibleJoin48: while (true) {
if (intention !== EmojiIntention.NO_CUSTOM_EMOJI) {
value4 = null;
value5 = value4 != channel;
reducibleJoin10: while (true) {
if (value5) {
isGuildTextChannelTypeBinding = isGuildTextChannelType;
type = channel.type;
isGuildTextChannelType2 = isGuildTextChannelTypeBinding(type);
r8 = isGuildTextChannelType2;
break reducibleJoin10;
}
r8 = value5;
break reducibleJoin10;
}
value6 = value4 != channel;
reducibleJoin12: while (true) {
if (value6) {
isGuildVocalChannelTypeBinding = isGuildVocalChannelType;
type = channel.type;
isGuildVocalChannelType2 = isGuildVocalChannelTypeBinding(type);
r6 = isGuildVocalChannelType2;
break reducibleJoin12;
}
r6 = value6;
break reducibleJoin12;
}
isInternalEmojiForGuildId2 = isInternalEmojiForGuildId(emoji, r11);
can = PermissionStore.can;
USE_EXTERNAL_EMOJIS = Permissions.USE_EXTERNAL_EMOJIS;
value7 = Reflect.apply(can, PermissionStore, [USE_EXTERNAL_EMOJIS, channel]);
COMMUNITY_CONTENT = EmojiIntention.COMMUNITY_CONTENT;
if (intention === COMMUNITY_CONTENT) {
reducibleJoin47: while (true) {
reducibleJoin46: while (true) {
if (isInternalEmojiForGuildId2) {
guildId = emoji.guildId;
if (value4 == guildId) {
break reducibleJoin46;
}
available = emoji.available;
if (available) {
DISALLOW_EXTERNAL = value4;
break reducibleJoin47;
}
break reducibleJoin46;
}
break reducibleJoin46;
}
DISALLOW_EXTERNAL = EmojiDisabledReasons.DISALLOW_EXTERNAL;
break reducibleJoin47;
}
return DISALLOW_EXTERNAL;
}
if (!isExternalEmojiAllowedForIntention(intention)) {
reducibleJoin17: while (true) {
if (isInternalEmojiForGuildId(emoji, r11)) {
break reducibleJoin17;
}
if (!forceIncludeExternalGuilds) {
return EmojiDisabledReasons.DISALLOW_EXTERNAL;
}
break reducibleJoin17;
}
}
if (!r8) {
reducibleJoin19: while (true) {
if (!r6) {
id = emoji.id;
if (value4 != id) {
available = emoji.available;
reducibleJoin25: while (true) {
if (!available) {
return EmojiDisabledReasons.GUILD_SUBSCRIPTION_UNAVAILABLE;
}
break reducibleJoin25;
}
}
getCurrentUser = UserStore.getCurrentUser;
value8 = Reflect.apply(getCurrentUser, UserStore, []);
defaultImport = importDefault(3802) /* metro dependency 3802: PremiumUtils */;
canUseEmojisEverywhere = defaultImport.canUseEmojisEverywhere;
if (!Reflect.apply(canUseEmojisEverywhere, defaultImport, [value8])) {
reducibleJoin31: while (true) {
if (isInternalEmojiForGuildId2) {
break reducibleJoin31;
}
STATUS = EmojiIntention.STATUS;
if (intention === STATUS) {
return EmojiDisabledReasons.PREMIUM_LOCKED;
}
managed = emoji.managed;
if (!managed) {
return EmojiDisabledReasons.PREMIUM_LOCKED;
}
break reducibleJoin31;
}
}
moduleValue = require(6545) /* metro dependency 6545: RoleSubscriptionEmojiUtils */;
isUnusableRoleSubscriptionEmoji = moduleValue.isUnusableRoleSubscriptionEmoji;
r4 = value4 != r11 ? r11 : value;
if (Reflect.apply(isUnusableRoleSubscriptionEmoji, moduleValue, [emoji, r4])) {
value = require(3777) /* metro dependency 3777: CreatorMonetizationRestrictionsUtils */;
shouldHideGuildPurchaseEntryPoints = value.shouldHideGuildPurchaseEntryPoints;
guildId = emoji.guildId;
value = Reflect.apply(shouldHideGuildPurchaseEntryPoints, value, [guildId]);
if (value) {
ROLE_SUBSCRIPTION_UNAVAILABLE = EmojiDisabledReasons.ROLE_SUBSCRIPTION_UNAVAILABLE;
r5 = ROLE_SUBSCRIPTION_UNAVAILABLE;
} else {
ROLE_SUBSCRIPTION_LOCKED = EmojiDisabledReasons.ROLE_SUBSCRIPTION_LOCKED;
r5 = ROLE_SUBSCRIPTION_LOCKED;
}
r4 = r5;
} else {
animated = emoji.animated;
reducibleJoin37: while (true) {
if (animated) {
defaultImport2 = importDefault(3802) /* metro dependency 3802: PremiumUtils */;
canUseAnimatedEmojis = defaultImport2.canUseAnimatedEmojis;
if (Reflect.apply(canUseAnimatedEmojis, defaultImport2, [value8])) {
PREMIUM_LOCKED = value4;
break reducibleJoin37;
}
value = require(6545) /* metro dependency 6545: RoleSubscriptionEmojiUtils */;
isPurchasableRoleSubscriptionEmoji = value.isPurchasableRoleSubscriptionEmoji;
if (Reflect.apply(isPurchasableRoleSubscriptionEmoji, value, [emoji])) {
PREMIUM_LOCKED = value4;
break reducibleJoin37;
}
PREMIUM_LOCKED = EmojiDisabledReasons.PREMIUM_LOCKED;
break reducibleJoin37;
}
PREMIUM_LOCKED = value4;
break reducibleJoin37;
}
r4 = PREMIUM_LOCKED;
}
return r4;
}
break reducibleJoin19;
}
}
if (!isInternalEmojiForGuildId2) {
reducibleJoin22: while (true) {
if (!value7) {
return EmojiDisabledReasons.DISALLOW_EXTERNAL;
}
break reducibleJoin22;
}
}
id = emoji.id;
if (value4 != id) {
available = emoji.available;
reducibleJoin25: while (true) {
if (!available) {
return EmojiDisabledReasons.GUILD_SUBSCRIPTION_UNAVAILABLE;
}
break reducibleJoin25;
}
}
getCurrentUser = UserStore.getCurrentUser;
value8 = Reflect.apply(getCurrentUser, UserStore, []);
defaultImport = importDefault(3802) /* metro dependency 3802: PremiumUtils */;
canUseEmojisEverywhere = defaultImport.canUseEmojisEverywhere;
if (!Reflect.apply(canUseEmojisEverywhere, defaultImport, [value8])) {
reducibleJoin31: while (true) {
if (isInternalEmojiForGuildId2) {
break reducibleJoin31;
}
STATUS = EmojiIntention.STATUS;
if (intention === STATUS) {
return EmojiDisabledReasons.PREMIUM_LOCKED;
}
managed = emoji.managed;
if (!managed) {
return EmojiDisabledReasons.PREMIUM_LOCKED;
}
break reducibleJoin31;
}
}
moduleValue = require(6545) /* metro dependency 6545: RoleSubscriptionEmojiUtils */;
isUnusableRoleSubscriptionEmoji = moduleValue.isUnusableRoleSubscriptionEmoji;
r4 = value4 != r11 ? r11 : value;
if (Reflect.apply(isUnusableRoleSubscriptionEmoji, moduleValue, [emoji, r4])) {
value = require(3777) /* metro dependency 3777: CreatorMonetizationRestrictionsUtils */;
shouldHideGuildPurchaseEntryPoints = value.shouldHideGuildPurchaseEntryPoints;
guildId = emoji.guildId;
value = Reflect.apply(shouldHideGuildPurchaseEntryPoints, value, [guildId]);
if (value) {
ROLE_SUBSCRIPTION_UNAVAILABLE = EmojiDisabledReasons.ROLE_SUBSCRIPTION_UNAVAILABLE;
r5 = ROLE_SUBSCRIPTION_UNAVAILABLE;
} else {
ROLE_SUBSCRIPTION_LOCKED = EmojiDisabledReasons.ROLE_SUBSCRIPTION_LOCKED;
r5 = ROLE_SUBSCRIPTION_LOCKED;
}
r4 = r5;
} else {
animated = emoji.animated;
reducibleJoin37: while (true) {
if (animated) {
defaultImport2 = importDefault(3802) /* metro dependency 3802: PremiumUtils */;
canUseAnimatedEmojis = defaultImport2.canUseAnimatedEmojis;
if (Reflect.apply(canUseAnimatedEmojis, defaultImport2, [value8])) {
PREMIUM_LOCKED = value4;
break reducibleJoin37;
}
value = require(6545) /* metro dependency 6545: RoleSubscriptionEmojiUtils */;
isPurchasableRoleSubscriptionEmoji = value.isPurchasableRoleSubscriptionEmoji;
if (Reflect.apply(isPurchasableRoleSubscriptionEmoji, value, [emoji])) {
PREMIUM_LOCKED = value4;
break reducibleJoin37;
}
PREMIUM_LOCKED = EmojiDisabledReasons.PREMIUM_LOCKED;
break reducibleJoin37;
}
PREMIUM_LOCKED = value4;
break reducibleJoin37;
}
r4 = PREMIUM_LOCKED;
}
return r4;
}
break reducibleJoin48;
}
}
return EmojiDisabledReasons.DISALLOW_CUSTOM;
}
return null;
}
function _getEmojiColors() { // fn#29013, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3928:4286, offset: 0x00fb4918, size: 48 bytes, params: 1, frame: 14
return env0_3(_fun29015).apply(this, arguments);
}
function sanitizeEmojiName(a0) { // fn#29016, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3928:2803, offset: 0x00fb4992, size: 85 bytes, params: 2, frame: 15
var r2;
var r0;
var value;
let length = a0.replace(EMOJI_RE, '').slice(0, EMOJI_MAX_LENGTH).length;
if (length < 2) {
for (r2 = value; true; r2 = value) {
value = r2 + '_';
length = value.length;
if (!(length < 2)) {
r0 = value;
break;
}
}
} else {
r0 = value;
}
return r0;
}
function getEmojiUnavailableReasons({categoryEmojis, channel, guildId, intention}) { // fn#29017, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3928:3098, offset: 0x00fb49e7, size: 346 bytes, params: 2, frame: 30
var r5;
var r6;
var r7;
var r19;
var r0;
var r18;
var r16;
var r17;
var r1;
var r2;
var value7;
var emojiUnavailableReason;
var binding;
var has;
var id;
var add;
var PREMIUM_LOCKED;
var value9;
var value10;
var value11;
var value12;
const Set = global.Set;
const set = new Set();
const items2 = [];
const value3 = _createForOfIteratorHelperLoose_29007(categoryEmojis);
const value4 = value3();
let done = value4.done;
if (done) {
r1 = false;
r2 = 0;
} else {
r5 = false;
r6 = 0;
r7 = value4;
while (true) {
value7 = r7.value;
emojiUnavailableReason = getEmojiUnavailableReason({emoji: value7, channel: channel, guildId: guildId,
intention: intention});
if (emojiUnavailableReason != null) {
binding = env0_17;
has = binding.has;
if (Reflect.apply(has, binding, [emojiUnavailableReason])) {
continue;
}
items2.push(value7);
binding = env0_16;
has = binding.has;
if (Reflect.apply(has, binding, [emojiUnavailableReason])) {
id = value7.id;
if (id == null) {
continue;
}
add = set.add;
id = value7.id;
Reflect.apply(add, set, [id]);
binding = env0_15;
has = binding.has;
if (!Reflect.apply(has, binding, [emojiUnavailableReason])) {
r0 = r5;
r18 = r6;
continue;
}
if (r5) {
r19 = r5;
continue;
}
PREMIUM_LOCKED = EmojiDisabledReasons.PREMIUM_LOCKED;
value9 = emojiUnavailableReason !== PREMIUM_LOCKED;
r19 = value9;
if (r19) {
continue;
}
value10 = true;
r5 = value10;
value11 = typeof r6 === 'bigint' ? r6 + 1n : +r6 + 1;
r0 = r5;
r18 = value11;
r16 = r0;
r17 = r18;
break;
}
r16 = r5;
r17 = r6;
break;
}
items2.push(value7);
r16 = r5;
r17 = r6;
value12 = value3();
done = value12.done;
if (done) {
r1 = r16;
r2 = r17;
break;
}
r5 = r16;
r6 = r17;
r7 = value12;
continue;
}
}
return {emojisDisabled: set, emojisUnfiltered: items2, emojisPremiumLockedCount: r2, emojiNitroLocked: r1};
}
function isEmojiFiltered(a0) { // fn#29018, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3928:3570, offset: 0x00fb4b41, size: 33 bytes, params: 2, frame: 12
return env0_17.has(getEmojiUnavailableReason(a0));
}
function isEmojiPremiumLocked(a0) { // fn#29019, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3928:3641, offset: 0x00fb4b62, size: 33 bytes, params: 2, frame: 12
return env0_15.has(getEmojiUnavailableReason(a0));
}
function isEmojiCategoryNitroLocked({categoryEmojis, channel, guildId, intention}) { // fn#29020, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3928:3717, offset: 0x00fb4b83, size: 184 bytes, params: 2, frame: 25
var r4;
var r5;
var r6;
var r14;
var r15;
var r0;
var r2;
var getEmojiUnavailableReasonBinding;
var value6;
var emojiUnavailableReasonBinding;
var PREMIUM_LOCKED;
var GUILD_SUBSCRIPTION_UNAVAILABLE;
var value8;
var value9;
var value10;
var value11;
const value2 = _createForOfIteratorHelperLoose_29007(categoryEmojis);
const value3 = value2();
let done = value3.done;
if (done) {
r0 = false;
r2 = 0;
} else {
r4 = 0;
r5 = false;
r6 = value3;
while (true) {
getEmojiUnavailableReasonBinding = getEmojiUnavailableReason;
value6 = r6.value;
emojiUnavailableReasonBinding = getEmojiUnavailableReasonBinding({emoji: value6, channel: channel,
intention: intention, guildId: guildId});
PREMIUM_LOCKED = EmojiDisabledReasons.PREMIUM_LOCKED;
if (emojiUnavailableReasonBinding !== PREMIUM_LOCKED) {
GUILD_SUBSCRIPTION_UNAVAILABLE = EmojiDisabledReasons.GUILD_SUBSCRIPTION_UNAVAILABLE;
if (emojiUnavailableReasonBinding !== GUILD_SUBSCRIPTION_UNAVAILABLE) {
r14 = r4;
r15 = r5;
break;
}
value8 = typeof r4 === 'bigint' ? r4 + 1n : +r4 + 1;
r14 = value8;
r15 = r5;
break;
}
value9 = typeof r4 === 'bigint' ? r4 + 1n : +r4 + 1;
value10 = true;
r14 = value9;
r15 = value10;
value11 = value2();
done = value11.done;
if (done) {
r0 = r15;
r2 = r14;
break;
}
r4 = r14;
r5 = r15;
r6 = value11;
continue;
}
}
r0 = r0 && r2 === categoryEmojis.length;
return r0;
}
function isEmojiDisabled(a0) { // fn#29022, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3928:4136, offset: 0x00fb4c5c, size: 33 bytes, params: 2, frame: 12
return env0_16.has(getEmojiUnavailableReason(a0));
}
function countEmoji(a0, a1) { // fn#29025, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3928:4501, offset: 0x00fb4cc2, size: 117 bytes, params: 3, frame: 12
const env0_0 = a1;
const env0_1 = 0;
const env0_2 = 0;
const env0_3 = 0;
const env0_4 = 0;
const env0_5 = 0;
const env0_6 = 0;
a0.forEach(_fun29026);
return {unicode: env0_1, custom: env0_2, customExternal: env0_3, managed: env0_4, managedExternal: env0_5,
animated: env0_6};
}
function getEmojiUrl({id, name, animated}) { // fn#29028, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3928:4890, offset: 0x00fb4df5, size: 134 bytes, params: 2, frame: 17
var r0;
let value = a1;
if (id != null) {
value = importDefault(1423) /* metro dependency 1423: AvatarUtils */;
value = value.getEmojiURL({id: id, size: value !== undefined ? value : 32,
animated: animated != null && animated});
r0 = value;
} else {
value = importDefault(7171) /* metro dependency 7171: EmojiUtilsPlatformedNative */;
value = value.getURL(name);
r0 = value;
}
return r0;
}
function* _fun29015(a0) { // fn#29015, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3928:4339, offset: 0x00fb4951, size: 65 bytes, params: 2, frame: 12
if (true) {
value = environment.__proto__.__proto__;
value = env2_1(env2_2[10]);
var getEmojiColors = value.getEmojiColors;
yield Reflect.apply(getEmojiColors, value, [a0]);
}
}
function _fun29026(a0) { // fn#29026, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3928:4572, offset: 0x00fb4d37, size: 190 bytes, params: 2, frame: 13
var value;
var binding;
var type;
if (a0.id != null) {
type = a0.type;
value = environment.__proto__;
binding = type === (require(3800) /* metro dependency 3800: EmojiTypes */).EmojiTypes.GUILD ? a0.guildId === require ? a0.managed ? env0_4 : env0_2 : a0.managed ? env0_5 : env0_3 : binding;
if (a0.animated) {
binding = env0_6;
env0_6 = typeof binding === 'bigint' ? binding + 1n : +binding + 1;
}
} else {
binding = env0_1;
env0_1 = typeof binding === 'bigint' ? binding + 1n : +binding + 1;
}
}
@@ -0,0 +1,195 @@
/* Metro module 7171; source: utils/EmojiUtilsPlatformed.native.tsx; dependencies: [57, 5, 27, 3798, 4092, 477, 22, 1423, 7172, 1475, 4000, 7211, 7216, 2] */
function _fun57583(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57583, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7349:6, offset: 0x013e9948, size: 263 bytes, params: 8, frame: 20
var object2;
const env0_0 = require;
const closure = getURL;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importDefault(5) /* metro dependency 5 */;
let value = require(27) /* metro dependency 27 */;
const env0_5 = value.NativeModules;
const env0_6 = value.processColor;
const twemojiNpm = importDefault(3798) /* metro dependency 3798: twemojiNpm */;
object2 = {};
object2.getURL = (importDefault(7216) /* metro dependency 7216: MemoizerUtils */).makeMemoizer(closure);
object2.filterUnsupportedEmojis = function(a0) {
var r0;
var value = a0;
if (require(dependencyMap[5]).isAndroid()) {
r0 = value;
} else {
value = importDefault(dependencyMap[6]).filter(value, _fun57590);
r0 = value;
}
return r0;
};
object2.applyPlatformToThemedEmojiColorPalette = applyPlatformToThemedEmojiColorPalette;
object2.getEmojiColors = function() {
return _getEmojiColors_57585.apply(this, arguments);
};
object2.triggerFullscreenAnimation = triggerFullscreenAnimation;
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/EmojiUtilsPlatformed.native.tsx');
exports.default = object2;
}
function getURL(a0) { // fn#57584, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7349:171, offset: 0x013e9a4f, size: 108 bytes, params: 2, frame: 14
var r0;
var value;
if (a0 == null) {
value = twemojiNpm.convert.toCodePoint(a0);
value = 'asset:/emoji-' + value + '.png';
r0 = value;
} else {
value = require(477) /* metro dependency 477: PlatformUtils */;
value = value.isAndroid();
if (value) {
value = twemojiNpm.convert.toCodePoint(a0);
value = 'asset:/emoji-' + value + '.png';
r0 = value;
} else {
r0 = '';
}
}
return r0;
}
function _getEmojiColors_57585() { // fn#57585, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7349:277, offset: 0x013e9abb, size: 48 bytes, params: 1, frame: 14
return env0_4(_fun57587).apply(this, arguments);
}
function filterUnsupportedEmojis(a0) { // fn#57589, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7349:787, offset: 0x013e9c5d, size: 84 bytes, params: 2, frame: 15
var r0;
let value = a0;
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
if (platformUtilsModule.isAndroid()) {
r0 = value;
} else {
value = (importDefault(22) /* metro dependency 22 */).filter(value, _fun57590);
r0 = value;
}
return r0;
}
function applyPlatformToThemedEmojiColorPalette({palette, shouldProcessMobileColors}) { // fn#57591, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7349:1452, offset: 0x013e9ec3, size: 275 bytes, params: 2, frame: 19
var accentColor;
var backgroundColor;
var highlightColor;
var opacity;
var LIGHT;
var DARK;
var object4;
var object5;
var processColorBinding;
var object6;
shouldProcessMobileColors = !(shouldProcessMobileColors === undefined) && shouldProcessMobileColors;
if (shouldProcessMobileColors) {
if (palette == null) {
return palette;
}
LIGHT = palette.LIGHT;
DARK = palette.DARK;
object4 = {};
object5 = {};
processColorBinding = processColor;
accentColor = LIGHT?.accentColor;
object5.accentColor = processColorBinding(accentColor);
processColorBinding = processColor;
backgroundColor = LIGHT?.backgroundColor;
object5.backgroundColor = processColorBinding(backgroundColor);
processColorBinding = processColor;
highlightColor = LIGHT?.highlightColor;
object5.highlightColor = processColorBinding(highlightColor);
opacity = LIGHT?.opacity;
object5.opacity = opacity;
object4.LIGHT = object5;
object6 = {};
processColorBinding = processColor;
accentColor = DARK?.accentColor;
object6.accentColor = processColorBinding(accentColor);
processColorBinding = processColor;
backgroundColor = DARK?.backgroundColor;
object6.backgroundColor = processColorBinding(backgroundColor);
processColorBinding = processColor;
highlightColor = DARK?.highlightColor;
object6.highlightColor = processColorBinding(highlightColor);
opacity = DARK?.opacity;
object6.opacity = opacity;
object4.DARK = object6;
return object4;
}
return palette;
}
function triggerFullscreenAnimation({channelId, messageId, emoji}) { // fn#57593, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7349:2087, offset: 0x013e9fd6, size: 72 bytes, params: 2, frame: 15
const burstReactionFirstSendActionSheetModule = require(7211) /* metro dependency 7211: BurstReactionFirstSendActionSheet */;
burstReactionFirstSendActionSheetModule.openBurstReactionFirstSendActionSheet({channelId: channelId,
messageId: messageId, emoji: emoji});
}
function* _fun57587(a0) { // fn#57587, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7349:330, offset: 0x013e9af4, size: 285 bytes, params: 2, frame: 18
var environment;
var r6;
var binding;
var value4;
let value = undefined;
if (false) {
return value;
}
const id = a0.id;
let name = a0.name;
if (id != null) {
value = environment.__proto__.__proto__;
value = env2_1(env2_2[7]);
value = value.getEmojiURL({'id': null, 'size': 32, 'animated': false, id: id});
r6 = value;
} else {
value = environment.__proto__.__proto__;
value = env2_8(name);
r6 = value;
}
if (r6 !== '') {
value = environment.__proto__.__proto__;
binding = env2_0;
value = undefined;
value4 = binding(env2_2[9]);
yield value4.getPaletteForAvatar(r6);
} else {
value = environment.__proto__.__proto__;
var ImageManager = env2_5.ImageManager;
var getEmojiBase64 = ImageManager.getEmojiBase64;
name = a0.name;
var EMOJI_IN_ANIMATION_SIZE = env2_0(env2_2[8]).EMOJI_IN_ANIMATION_SIZE;
yield Reflect.apply(getEmojiBase64, ImageManager, [name, EMOJI_IN_ANIMATION_SIZE]);
if (false) {
return undefined;
}
value = 'data:image/png;base64,' + value;
r6 = value;
value = environment.__proto__.__proto__;
binding = env2_0;
value = undefined;
value4 = binding(env2_2[9]);
yield value4.getPaletteForAvatar(r6);
}
const value5 = undefined;
if (false) {
return value5;
}
return value5 == null ? value : value5.map(_fun57588);
}
function _fun57590({unicodeVersion}) { // fn#57590, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7349:870, offset: 0x013e9cb1, size: 530 bytes, params: 2, frame: 15
let value = environment.__proto__;
value = require(4092) /* metro dependency 4092: DeviceUtils */;
value = value.getSystemVersionMajor();
const systemVersionMinor = (require(4092) /* metro dependency 4092: DeviceUtils */).getSystemVersionMinor();
return !(unicodeVersion > 8) || (unicodeVersion === 9 ? value > 10 || value === 10 && systemVersionMinor >= 2 : unicodeVersion === 10 ? value > 11 || value === 11 && systemVersionMinor >= 1 : unicodeVersion === 11 ? value > 12 || value === 12 && systemVersionMinor >= 1 : unicodeVersion === 12 || unicodeVersion === 12.1 ? value > 13 || value === 13 && systemVersionMinor >= 2 : unicodeVersion === 13 ? value > 14 || value === 14 && systemVersionMinor >= 2 : unicodeVersion === 13.1 ? value > 14 || value === 14 && systemVersionMinor >= 5 : unicodeVersion === 14 ? value > 15 || value === 15 && systemVersionMinor >= 4 : unicodeVersion === 15 ? value > 16 || value === 16 && systemVersionMinor >= 4 : unicodeVersion === 15.1 ? value > 17 || value === 17 && systemVersionMinor >= 4 : !(unicodeVersion !== 16) && (value > 18 || value === 18 && systemVersionMinor >= 4));
}
function _fun57588(a0) { // fn#57588, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7349:620, offset: 0x013e9c11, size: 76 bytes, params: 2, frame: 17
const value = environment.__proto__.__proto__.__proto__;
const value2 = env3_3(a0, 3);
return env3_0(env3_2[10]).rgbToHex(value2[0], value2[1], value2[2]);
}
+33
View File
@@ -0,0 +1,33 @@
/* Metro module 12844; source: utils/ErrorCommonUtils.tsx; dependencies: [694, 571, 2] */
function _fun97997(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#97997, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13034:6, offset: 0x0219874a, size: 103 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/ErrorCommonUtils.tsx');
exports.getUpdatedOptions = getUpdatedOptions;
}
function getUpdatedOptions(a0) { // fn#97998, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13034:172, offset: 0x021987b1, size: 189 bytes, params: 2, frame: 19
var r4;
var object4;
const object6 = {};
copyDataProperties(object6, a0, undefined);
const object7 = {};
copyDataProperties(object7, a0?.extra, undefined);
const object8 = {};
if ((importDefault(694) /* metro dependency 694: Dispatcher */)._currentDispatchActionType != null) {
object4 = {};
object4.currentAction = (importDefault(694) /* metro dependency 694: Dispatcher */)._currentDispatchActionType;
r4 = object4;
} else {
r4 = {};
}
copyDataProperties(object8, r4, 0);
value = require(571) /* metro dependency 571: LastFewActions */;
value = value.serialize();
object8['lastFewActions'] = value;
copyDataProperties(object7, object8, 0);
object6['extra'] = object7;
return object6;
}
+56
View File
@@ -0,0 +1,56 @@
/* Metro module 7362; source: utils/ErrorUtils.tsx; dependencies: [7363, 2] */
function _fun59318(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#59318, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7540:6, offset: 0x016e5989, size: 116 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/ErrorUtils.tsx');
exports.getUnderlyingIOSError = getUnderlyingIOSError;
exports.serializeError = serializeError;
}
function getUnderlyingIOSExceptionRecursively(a0) { // fn#59319, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7540:44, offset: 0x016e59fd, size: 69 bytes, params: 2, frame: 13
let userInfo = a0.userInfo;
let NSUnderlyingError = userInfo.NSUnderlyingError;
if (NSUnderlyingError == null) {
return a0.userInfo.NSLocalizedDescription;
}
const getUnderlyingIOSExceptionRecursivelyBinding = getUnderlyingIOSExceptionRecursively;
userInfo = a0.userInfo;
NSUnderlyingError = userInfo.NSUnderlyingError;
const underlyingIOSExceptionRecursivelyBinding = getUnderlyingIOSExceptionRecursivelyBinding(NSUnderlyingError);
if (underlyingIOSExceptionRecursivelyBinding != null) {
return underlyingIOSExceptionRecursivelyBinding;
}
userInfo = a0.userInfo;
return userInfo.NSLocalizedDescription;
}
function getUnderlyingIOSError(a0) { // fn#59320, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7540:395, offset: 0x016e5a42, size: 42 bytes, params: 2, frame: 12
var r0;
var value;
var value2;
var value3;
var error;
try {
value = environment;
value = getUnderlyingIOSExceptionRecursively(a0);
value2 = null;
value3 = value2 != value;
r0 = value3 ? value : value2;
} catch (error) {
return null;
}
return r0;
}
function serializeError(a0) { // fn#59321, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7540:544, offset: 0x016e5a6c, size: 156 bytes, params: 2, frame: 15
let value = a0;
const Boolean = global.Boolean;
const r2 = Boolean(value) ? value : new global.Error('unknown error');
const r4 = typeof r2 === 'object' ? r2 : new global.Error(global.String(r2));
const JSON = global.JSON;
const stringify = JSON.stringify;
value = require(7363) /* metro dependency 7363 */;
return Reflect.apply(stringify, JSON, [value.normalizeToSize(r4)]);
}
+647
View File
@@ -0,0 +1,647 @@
/* Metro module 4112; source: utils/ExperimentUtils.tsx; dependencies: [57, 4107, 4108, 4106, 22, 2] */
function _fun33764(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#33764, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4277:6, offset: 0x0103afc8, size: 253 bytes, params: 8, frame: 20
var object2;
let env0_0 = require;
const _arrayLikeToArray_33767 = 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(a0) {
var value4;
var value5;
var value6;
var value2 = _createForOfIteratorHelperLoose_33765(a0);
var value3 = value2();
if (value3.done) {
return null;
}
var r4 = value3;
loopExit1: while (true) {
value4 = r4.value;
value5 = ExperimentStore.getUserExperimentDescriptor(value4);
if (value5 != null) {
break loopExit1;
}
value6 = value2();
if (value6.done) {
return null;
}
r4 = value6;
continue;
}
return [value4, value5];
};
let Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const experimentStore = importDefault(4107) /* metro dependency 4107: ExperimentStore */;
const experimentConstantsModule = require(4108) /* metro dependency 4108: ExperimentConstants */;
const env0_5 = experimentConstantsModule.ExperimentTypes;
const env0_6 = experimentConstantsModule.ExperimentBuckets;
object2 = {getFirstEligibleUserExperiment: closure, isInExperimentBucket: isInExperimentBucket,
experimentDescriptorEquals: experimentDescriptorEquals,
trackExposureToFirstEligibleUserExperiment: trackExposureToFirstEligibleUserExperiment,
getExperimentBucketName: getExperimentBucketName, getRecentExperimentBuckets: function(a0, a1) {
var env0_0 = a1;
var Object = global.Object;
return Object.entries(a0).reduce(_fun33774, {});
}};
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/ExperimentUtils.tsx');
exports.default = object2;
}
function _createForOfIteratorHelperLoose_33765(a0, a1) { // fn#33765, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4277:173, offset: 0x0103b0c5, 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 _fun33766;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_33767(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_33767(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_33767(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun33766;
}
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 isInExperimentBucket(a0, a1) { // fn#33769, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4277:1363, offset: 0x0103b292, size: 32 bytes, params: 3, frame: 11
return ExperimentStore.getUserExperimentBucket(a0) === a1;
}
function experimentDescriptorEquals(a0, a1) { // fn#33770, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4277:1466, offset: 0x0103b2b2, size: 224 bytes, params: 3, frame: 14
var type;
var value;
var USER;
if (a0 != null) {
if (a0 === a1) {
return true;
}
if (a0 != null) {
if (a0 == null) {
if (a0 == null) {
return true;
}
if (a1 == null) {
return true;
}
type = a0.type;
if (type !== a1.type) {
return false;
}
if (a0.bucket !== a1.bucket) {
return false;
}
if (a0.revision !== a1.revision) {
return false;
}
type = a0.type;
USER = ExperimentTypes.USER;
if (type !== USER) {
return true;
}
type = a1.type;
USER = ExperimentTypes.USER;
if (type === USER) {
value = importDefault(22) /* metro dependency 22 */;
return value.isEqual(a0.context, a1.context);
}
return true;
}
if (a1 == null) {
return false;
}
if (a0 == null) {
return true;
}
if (a1 == null) {
return true;
}
type = a0.type;
if (type !== a1.type) {
return false;
}
if (a0.bucket !== a1.bucket) {
return false;
}
if (a0.revision !== a1.revision) {
return false;
}
type = a0.type;
USER = ExperimentTypes.USER;
if (type !== USER) {
return true;
}
type = a1.type;
USER = ExperimentTypes.USER;
if (type === USER) {
value = importDefault(22) /* metro dependency 22 */;
return value.isEqual(a0.context, a1.context);
}
return true;
}
if (a1 != null) {
return false;
}
if (a0 == null) {
if (a0 == null) {
return true;
}
if (a1 == null) {
return true;
}
type = a0.type;
if (type !== a1.type) {
return false;
}
if (a0.bucket !== a1.bucket) {
return false;
}
if (a0.revision !== a1.revision) {
return false;
}
type = a0.type;
USER = ExperimentTypes.USER;
if (type !== USER) {
return true;
}
type = a1.type;
USER = ExperimentTypes.USER;
if (type === USER) {
value = importDefault(22) /* metro dependency 22 */;
return value.isEqual(a0.context, a1.context);
}
return true;
}
if (a1 == null) {
return false;
}
if (a0 == null) {
return true;
}
if (a1 == null) {
return true;
}
type = a0.type;
if (type !== a1.type) {
return false;
}
if (a0.bucket !== a1.bucket) {
return false;
}
if (a0.revision !== a1.revision) {
return false;
}
type = a0.type;
USER = ExperimentTypes.USER;
if (type !== USER) {
return true;
}
type = a1.type;
USER = ExperimentTypes.USER;
if (type === USER) {
value = importDefault(22) /* metro dependency 22 */;
return value.isEqual(a0.context, a1.context);
}
} else {
if (a1 == null) {
return true;
}
if (a0 === a1) {
return true;
}
if (a0 != null) {
if (a0 == null) {
if (a0 == null) {
return true;
}
if (a1 == null) {
return true;
}
type = a0.type;
if (type !== a1.type) {
return false;
}
if (a0.bucket !== a1.bucket) {
return false;
}
if (a0.revision !== a1.revision) {
return false;
}
type = a0.type;
USER = ExperimentTypes.USER;
if (type !== USER) {
return true;
}
type = a1.type;
USER = ExperimentTypes.USER;
if (type === USER) {
value = importDefault(22) /* metro dependency 22 */;
return value.isEqual(a0.context, a1.context);
}
return true;
}
if (a1 == null) {
return false;
}
if (a0 == null) {
return true;
}
if (a1 == null) {
return true;
}
type = a0.type;
if (type !== a1.type) {
return false;
}
if (a0.bucket !== a1.bucket) {
return false;
}
if (a0.revision !== a1.revision) {
return false;
}
type = a0.type;
USER = ExperimentTypes.USER;
if (type !== USER) {
return true;
}
type = a1.type;
USER = ExperimentTypes.USER;
if (type === USER) {
value = importDefault(22) /* metro dependency 22 */;
return value.isEqual(a0.context, a1.context);
}
return true;
}
if (a1 != null) {
return false;
}
if (a0 == null) {
if (a0 == null) {
return true;
}
if (a1 == null) {
return true;
}
type = a0.type;
if (type !== a1.type) {
return false;
}
if (a0.bucket !== a1.bucket) {
return false;
}
if (a0.revision !== a1.revision) {
return false;
}
type = a0.type;
USER = ExperimentTypes.USER;
if (type !== USER) {
return true;
}
type = a1.type;
USER = ExperimentTypes.USER;
if (type === USER) {
value = importDefault(22) /* metro dependency 22 */;
return value.isEqual(a0.context, a1.context);
}
return true;
}
if (a1 == null) {
return false;
}
if (a0 == null) {
return true;
}
if (a1 == null) {
return true;
}
type = a0.type;
if (type !== a1.type) {
return false;
}
if (a0.bucket !== a1.bucket) {
return false;
}
if (a0.revision !== a1.revision) {
return false;
}
type = a0.type;
USER = ExperimentTypes.USER;
if (type !== USER) {
return true;
}
type = a1.type;
USER = ExperimentTypes.USER;
if (type === USER) {
value = importDefault(22) /* metro dependency 22 */;
return value.isEqual(a0.context, a1.context);
}
}
return true;
}
function trackExposureToFirstEligibleUserExperiment(a0) { // fn#33771, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4277:1862, offset: 0x0103b392, size: 85 bytes, params: 2, frame: 15
var value3;
var property;
var property2;
const firstEligibleUserExperiment = getFirstEligibleUserExperiment(a0);
if (firstEligibleUserExperiment != null) {
value3 = env0_3(firstEligibleUserExperiment, 2);
property = value3[0];
property2 = value3[1];
(require(4106) /* metro dependency 4106: ExperimentManager */).trackExposureToExperiment(property, property2);
return property2;
}
}
function getExperimentBucketName(a0) { // fn#33772, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4277:2071, offset: 0x0103b3e7, size: 75 bytes, params: 2, frame: 13
const CONTROL = ExperimentBuckets.CONTROL;
return a0 === CONTROL ? 'Control' : a0 === ExperimentBuckets.NOT_ELIGIBLE ? 'Not Eligible' : 'Treatment ' + a0;
}
function getRecentExperimentBuckets(a0, a1) { // fn#33773, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4277:2217, offset: 0x0103b432, size: 52 bytes, params: 3, frame: 13
const env0_0 = a1;
const Object = global.Object;
return Object.entries(a0).reduce(_fun33774, {});
}
function _fun33774(a0, a1) { // fn#33774, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4277:2291, offset: 0x0103b466, size: 254 bytes, params: 3, frame: 22
var r1;
var r3;
var r4;
var item3;
var value3;
var split;
var value5;
var binding;
var property;
var property2;
var slice;
var Date;
var concat;
var prototype;
var date;
var error;
var CONTROL;
const iterator = a1[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
let value = undefined;
const value2 = item2 === value;
const r2 = value2 ? value : item;
reducibleJoin3: while (true) {
if (value2) {
r1 = value;
r3 = item2;
r4 = value2;
break reducibleJoin3;
}
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r1 = value;
r3 = item3;
r4 = value3;
break reducibleJoin3;
}
r1 = item;
r3 = item3;
r4 = value3;
break reducibleJoin3;
}
reducibleJoin5: while (true) {
if (r4) {
break reducibleJoin5;
}
r3.return();
break reducibleJoin5;
}
reducibleJoin8: while (true) {
reduciblePort38: while (true) {
exceptionLanding37: while (true) {
try {
split = r2.split;
} catch (error) {
break exceptionLanding37;
}
break reducibleJoin8;
}
value = false;
r3 = value;
break reduciblePort38;
}
reducibleJoin40: while (true) {
if (r3) {
value = environment.__proto__;
CONTROL = ExperimentBuckets.CONTROL;
value = r1 > CONTROL;
r3 = value;
break reducibleJoin40;
}
break reducibleJoin40;
}
reducibleJoin42: while (true) {
if (r3) {
a0[r2] = r1;
break reducibleJoin42;
}
break reducibleJoin42;
}
return a0;
}
try {
value5 = Reflect.apply(split, r2, ['-']);
} catch (error) {
break exceptionLanding37;
}
try {
binding = env1_3;
} catch (error) {
break exceptionLanding37;
}
try {
value = binding(value5, 2);
} catch (error) {
break exceptionLanding37;
}
try {
property = value[0];
} catch (error) {
break exceptionLanding37;
}
try {
property2 = value[1];
} catch (error) {
break exceptionLanding37;
}
try {
value = property2 == null;
} catch (error) {
break exceptionLanding37;
}
if (value) {
value = false;
r3 = value;
} else {
try {
slice = property2.slice;
} catch (error) {
break exceptionLanding37;
}
try {
value = Reflect.apply(slice, property2, [0, 2]);
} catch (error) {
break exceptionLanding37;
}
try {
Date = global.Date;
} catch (error) {
break exceptionLanding37;
}
try {
} catch (error) {
break exceptionLanding37;
}
try {
} catch (error) {
break exceptionLanding37;
}
try {
value = Reflect.apply(concat, '', [property, '-', value, '-01']);
} catch (error) {
break exceptionLanding37;
}
try {
prototype = Date.prototype;
} catch (error) {
break exceptionLanding37;
}
try {
} catch (error) {
break exceptionLanding37;
}
try {
date = new Date(value);
} catch (error) {
break exceptionLanding37;
}
try {
value = date instanceof Object ? date : undefined;
} catch (error) {
break exceptionLanding37;
}
try {
value = value > require;
} catch (error) {
break exceptionLanding37;
}
r3 = value;
}
reducibleJoin40: while (true) {
if (r3) {
value = environment.__proto__;
CONTROL = ExperimentBuckets.CONTROL;
value = r1 > CONTROL;
r3 = value;
break reducibleJoin40;
}
break reducibleJoin40;
}
reducibleJoin42: while (true) {
if (r3) {
a0[r2] = r1;
break reducibleJoin42;
}
break reducibleJoin42;
}
return a0;
}
+194
View File
@@ -0,0 +1,194 @@
/* Metro module 11218; source: utils/FileManagerUtils.android.tsx; dependencies: [5, 3, 1279, 2] */
function _fun85744(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85744, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11404:6, offset: 0x01f7a792, size: 219 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(5) /* metro dependency 5 */;
let value = importDefault(3) /* metro dependency 3: Logger */;
value = new value('FileManagerUtils');
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/FileManagerUtils.android.tsx');
exports.writeFile = writeFile;
exports.moveFile = moveFile;
exports.removeFile = removeFile;
exports.clearFolder = clearFolder;
exports.readFile = function() {
return _readFile.apply(this, arguments);
};
}
function _readFile() { // fn#85745, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11404:143, offset: 0x01f7a86d, size: 50 bytes, params: 1, frame: 14
return env0_2(_fun85747).apply(this, arguments);
}
function writeFile(a0, a1, a2, a3) { // fn#85748, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11404:655, offset: 0x01f7a9d4, size: 128 bytes, params: 5, frame: 19
var r0;
var value;
if ((importDefault(1279) /* metro dependency 1279: NativeFileModule */) == null) {
r0 = undefined;
} else {
value = importDefault(1279) /* metro dependency 1279: NativeFileModule */;
value = value.writeFile(a0, a1, a2, a3);
value = value.then(function(a0) {
return 'file:' + a0;
});
r0 = value;
}
r0 = r0 ?? global.Promise.reject("RTNFileManager doesn't exist?");
return r0;
}
function moveFile(a0, a1, a2) { // fn#85750, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11404:840, offset: 0x01f7aa71, size: 102 bytes, params: 4, frame: 17
var r0;
var value;
if ((importDefault(1279) /* metro dependency 1279: NativeFileModule */) == null) {
r0 = undefined;
} else {
value = importDefault(1279) /* metro dependency 1279: NativeFileModule */;
value = value.moveFile(a0, a1, a2);
r0 = value;
}
r0 = r0 ?? global.Promise.reject(false);
return r0;
}
function removeFile(a0, a1) { // fn#85751, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11404:969, offset: 0x01f7aad7, size: 98 bytes, params: 3, frame: 15
var r0;
var value;
if ((importDefault(1279) /* metro dependency 1279: NativeFileModule */) == null) {
r0 = undefined;
} else {
value = importDefault(1279) /* metro dependency 1279: NativeFileModule */;
value = value.removeFile(a0, a1);
r0 = value;
}
r0 = r0 ?? global.Promise.reject(false);
return r0;
}
function clearFolder(a0, a1) { // fn#85752, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11404:1099, offset: 0x01f7ab39, size: 98 bytes, params: 3, frame: 15
var r0;
var value;
if ((importDefault(1279) /* metro dependency 1279: NativeFileModule */) == null) {
r0 = undefined;
} else {
value = importDefault(1279) /* metro dependency 1279: NativeFileModule */;
value = value.clearFolder(a0, a1);
r0 = value;
}
r0 = r0 ?? global.Promise.reject(false);
return r0;
}
function* _fun85747(a0, a1, a2) { // fn#85747, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11404:184, offset: 0x01f7a8aa, size: 298 bytes, params: 4, frame: 22
var r6;
var r2;
var value5;
var value6;
var binding2;
var property;
var value10;
var readFile;
var value11;
var value12;
var value13;
var value14;
var value15;
var error;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
let binding = env2_0;
const value3 = binding(env2_1[2]);
const value4 = null;
if (value4 == value3) {
r2 = value4;
} else {
if (a0 === 'cache') {
value6 = env2_0(env2_1[2]);
r6 = value6.getConstants().CacheDirPath;
} else {
value5 = env2_0(env2_1[2]);
r6 = value5.getConstants().DocumentsDirPath;
}
r2 = r6;
}
if (value4 == r2) {
return value4;
}
const value7 = env2_0(env2_1[2]);
yield value7.fileExists(r2 + '/' + a1);
const value8 = undefined;
if (false) {
return value8;
}
if (!value8) {
return value4;
}
try {
binding = env2_0;
} catch (error) {
binding = env2_3;
binding.error('Failed to read file from disk', error);
return value4;
}
try {
binding2 = env2_1;
} catch (error) {
binding = env2_3;
binding.error('Failed to read file from disk', error);
return value4;
}
try {
property = binding2[2];
} catch (error) {
binding = env2_3;
binding.error('Failed to read file from disk', error);
return value4;
}
try {
value10 = binding(property);
} catch (error) {
binding = env2_3;
binding.error('Failed to read file from disk', error);
return value4;
}
try {
readFile = value10.readFile;
} catch (error) {
binding = env2_3;
binding.error('Failed to read file from disk', error);
return value4;
}
try {
value11 = r2 + '/';
} catch (error) {
binding = env2_3;
binding.error('Failed to read file from disk', error);
return value4;
}
try {
value12 = value11 + a1;
} catch (error) {
binding = env2_3;
binding.error('Failed to read file from disk', error);
return value4;
}
try {
value13 = Reflect.apply(readFile, value10, [value12, a2]);
} catch (error) {
binding = env2_3;
binding.error('Failed to read file from disk', error);
return value4;
}
yield value13;
try {
value14 = undefined;
value15 = false;
} catch (error) {
binding = env2_3;
binding.error('Failed to read file from disk', error);
return value4;
}
return value15 ? value14 : value14;
}
+83
View File
@@ -0,0 +1,83 @@
/* Metro module 4136; source: utils/FileSizeUtils.tsx; dependencies: [1244, 2] */
function _fun34338(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#34338, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4307:6, offset: 0x01053560, size: 151 bytes, params: 8, frame: 19
const env0_0 = require;
const closure = formatSize;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = {'useKibibytes': false, 'showDecimalForGB': true, 'useSpace': true};
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/FileSizeUtils.tsx');
exports.BYTE_IN_KB = 1024;
exports.KB_IN_MB = 1024;
exports.formatSize = closure;
exports.formatKbSize = formatKbSize;
}
function formatSize(a0) { // fn#34339, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4307:155, offset: 0x010535f7, size: 332 bytes, params: 2, frame: 19
var useSpace;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var formatToPlainString;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
let value = a1;
let r0 = value !== undefined ? value : env0_3;
let useKibibytes = r0.useKibibytes;
value = 1000;
const r7 = useKibibytes ? env0_2 : value;
useKibibytes = r0.useKibibytes;
const r1 = useKibibytes ? 1024 : value;
let Math = global.Math;
value = Math.ceil(a0 / r7);
if (value < r1) {
useSpace = r0.useSpace;
formatToPlainString = intl.formatToPlainString;
r0 = useSpace ? Reflect.apply(formatToPlainString, intl, [t.cS889N,
{size: value}]) : Reflect.apply(formatToPlainString, intl, [t.pIn7Af, {size: value}]);
return r0;
}
value /= r1;
const showDecimalForGB = r0.showDecimalForGB;
Math = global.Math;
const round = Math.round;
const r8 = showDecimalForGB ? Reflect.apply(round, Math, [10 * value]) / 10 : Reflect.apply(round, Math, [value]);
useSpace = r0.useSpace;
formatToPlainString = intl.formatToPlainString;
return useSpace ? Reflect.apply(formatToPlainString, intl, [t.yhEXX7,
{size: r8}]) : Reflect.apply(formatToPlainString, intl, [t.TbMX9D, {size: r8}]);
}
function formatKbSize(a0) { // fn#34340, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4307:727, offset: 0x01053743, size: 229 bytes, params: 2, frame: 19
var useSpace;
var intl;
var formatToPlainString;
var t;
var kEk9pr;
var object2;
var bTzRR6;
let value = a1;
const r4 = value !== undefined ? value : env0_3;
let useKibibytes = r4.useKibibytes;
value = 1000;
const value3 = a0 / (useKibibytes ? 1024 : value);
useKibibytes = r4.useKibibytes;
let r0 = useKibibytes ? env0_2 : value;
if (value3 / r0 >= 1) {
r0 = formatSize(value3, r4);
} else {
useSpace = r4.useSpace;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
formatToPlainString = intl.formatToPlainString;
t = (require(1244) /* metro dependency 1244: indexNative */).t;
if (useSpace) {
bTzRR6 = t.bTzRR6;
object2 = {};
object2.size = global.Math.ceil(value3);
r0 = Reflect.apply(formatToPlainString, intl, [bTzRR6, object2]);
} else {
kEk9pr = t.kEk9pr;
object2 = {};
object2.size = global.Math.ceil(value3);
r0 = Reflect.apply(formatToPlainString, intl, [kEk9pr, object2]);
}
}
return r0;
}
+340
View File
@@ -0,0 +1,340 @@
/* Metro module 4655; source: utils/FileUtils.tsx; dependencies: [1867, 1878, 661, 1880, 22, 4656, 4657, 3802, 4136, 1244, 2] */
function _fun40174(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#40174, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4833:6, offset: 0x010f8628, size: 928 bytes, params: 8, frame: 28
const env0_0 = require;
const _arrayLikeToArray_40177 = 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(a0, a1, a2) {
var File = global.File;
var value = Object.create(File.prototype, {constructor: {value: File}});
var value2 = new File([a0], a1, {type: a2});
return value2 instanceof Object ? value2 : value;
};
const closure2 = classifyFileName;
const closure3 = maxFileSize;
const closure4 = getUploadFileSizeSum;
const closure5 = getMaxRequestSize;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
let value = require(661) /* metro dependency 661: Constants */;
const GuildFeatures = value.GuildFeatures;
const env0_6 = value.MAX_ATTACHMENT_SIZE;
value = require(1880) /* metro dependency 1880: PremiumConstants */;
const MAX_GUILD_FILE_SIZE_50_MB = value.MAX_GUILD_FILE_SIZE_50_MB;
const MAX_GUILD_FILE_SIZE_100_MB = value.MAX_GUILD_FILE_SIZE_100_MB;
const MAX_GUILD_FILE_SIZE_250_MB = value.MAX_GUILD_FILE_SIZE_250_MB;
const env0_7 = value.MAX_PREMIUM_TIER_2_ATTACHMENT_SIZE;
const items3 = [{reType: RegExp('^image\\/vnd.adobe.photoshop', ''), klass: 'photoshop'}];
items3[1] = {reType: RegExp('^image\\/svg\\+xml', ''), klass: 'webcode'};
items3[2] = {reType: RegExp('^image\\/', ''), klass: 'image'};
items3[3] = {reType: RegExp('^video\\/', ''), klass: 'video'};
items3[4] = {reName: RegExp('\\.pdf$', ''), klass: 'acrobat'};
items3[5] = {reName: RegExp('\\.ae', ''), klass: 'ae'};
items3[6] = {reName: RegExp('\\.sketch$', ''), klass: 'sketch'};
items3[7] = {reName: RegExp('\\.ai$', ''), klass: 'ai'};
items3[8] = {reName: RegExp('\\.(?:rar|zip|7z|tar|tar\\.gz)$', ''), klass: 'archive'};
items3[9] = {reName: RegExp('\\.(?:c\\+\\+|cpp|cc|c|h|hpp|mm|m|json|js|ts|rb|rake|py|asm|fs|pyc|dtd|cgi|bat|rss|java|graphml|idb|lua|o|gml|prl|sls|conf|cmake|make|sln|vbe|cxx|wbf|vbs|r|wml|php|bash|applescript|fcgi|yaml|ex|exs|sh|ml|actionscript)$',
''), klass: 'code'};
items3[10] = {reName: RegExp('\\.(?:txt|rtf|doc|docx|md|pages|ppt|pptx|pptm|key|log)$', ''), klass: 'document'};
items3[11] = {reName: RegExp('\\.(?:xls|xlsx|numbers|csv)$', ''), klass: 'spreadsheet'};
items3[12] = {reName: RegExp('\\.(?:html|xhtml|htm|xml|xsd|css|styl)$', ''), klass: 'webcode'};
items3[13] = {reName: RegExp('\\.(?:mp3|ogg|opus|wav|aiff|flac)$', ''), klass: 'audio'};
const MAX_FILE_SIZE_250_MB = GuildFeatures.MAX_FILE_SIZE_250_MB;
const items2 = [[MAX_FILE_SIZE_250_MB, MAX_GUILD_FILE_SIZE_250_MB]];
const MAX_FILE_SIZE_100_MB = GuildFeatures.MAX_FILE_SIZE_100_MB;
items2[1] = [MAX_FILE_SIZE_100_MB, MAX_GUILD_FILE_SIZE_100_MB];
const MAX_FILE_SIZE_50_MB = GuildFeatures.MAX_FILE_SIZE_50_MB;
items2[2] = [MAX_FILE_SIZE_50_MB, MAX_GUILD_FILE_SIZE_50_MB];
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/FileUtils.tsx');
exports.transformNativeFile = transformNativeFile;
exports.makeFile = closure;
exports.classifyFile = function(a0) {
return classifyFileName(a0.name, a0.type);
};
exports.classifyFileName = closure2;
exports.sizeString = sizeString;
exports.maxFileSize = closure3;
exports.anyFileTooLarge = anyFileTooLarge;
exports.getUploadFileSizeSum = closure4;
exports.uploadSumTooLarge = function(a0) {
var value2 = getUploadFileSizeSum(a0);
getMaxRequestSize();
return value2 > 524288000;
};
exports.getMaxRequestSize = closure5;
exports.fileUploadLimitRoadblockDescription = fileUploadLimitRoadblockDescription;
}
function _createForOfIteratorHelperLoose_40175(a0, a1) { // fn#40175, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4833:315, offset: 0x010f89c8, 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 _fun40176;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_40177(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_40177(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_40177(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun40176;
}
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 classifyFileName(a0, a1) { // fn#40179, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4833:2148, offset: 0x010f8b75, size: 120 bytes, params: 3, frame: 16
let env0_0 = a0;
const env0_1 = a1;
env0_0 = a0?.toLowerCase() ?? '';
value = Reflect.apply((importDefault(22) /* metro dependency 22 */).find, value, [env0_8, _fun40180]);
return value != null ? value.klass : 'unknown';
}
function maxFileSize(a0) { // fn#40181, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4833:2469, offset: 0x010f8c55, size: 118 bytes, params: 2, frame: 16
const userMaxFileSize = (importDefault(3802) /* metro dependency 3802: PremiumUtils */).getUserMaxFileSize(UserStore.getCurrentUser());
if (a0 == null) {
return userMaxFileSize;
}
const guild = GuildStore.getGuild(a0);
const r3 = guild != null ? getGuildMaxFileSize(guild) : MAX_ATTACHMENT_SIZE;
const Math = global.Math;
return Math.max(r3, userMaxFileSize);
}
function getUploadFileSizeSum(a0) { // fn#40184, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4833:2852, offset: 0x010f8db7, size: 70 bytes, params: 2, frame: 16
var r2;
var r3;
var r0;
var value4;
var size;
var value5;
var value6;
const value = _createForOfIteratorHelperLoose_40175(a0);
const value2 = value();
let done = value2.done;
const value3 = 0;
if (done) {
r0 = value3;
} else {
r2 = value3;
for (r3 = value2; true; r3 = value6) {
value4 = r3.value;
size = value4.size;
value5 = r2 + size;
value6 = value();
done = value6.done;
if (done) {
r0 = value5;
break;
}
r2 = value5;
}
}
return r0;
}
function getMaxRequestSize() { // fn#40185, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4833:2977, offset: 0x010f8dfd, size: 40 bytes, params: 1, frame: 9
const currentUser = UserStore.getCurrentUser();
if (currentUser != null) {
currentUser.isStaff();
}
return 524288000;
}
function transformNativeFile(a0, a1) { // fn#40186, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4833:3146, offset: 0x010f8e25, size: 77 bytes, params: 3, frame: 17
var r0;
var makeFileBinding;
var buffer;
var filename;
let value = a0;
const value2 = a1;
const File = global.File;
if (value instanceof File) {
r0 = value;
} else {
makeFileBinding = makeFile;
buffer = value.data.buffer;
filename = value.filename;
value = 'text/plain';
value = makeFileBinding(buffer, filename, value2 ?? value);
r0 = value;
}
return r0;
}
function sizeString(a0) { // fn#40188, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4833:3419, offset: 0x010f8e90, size: 41 bytes, params: 2, frame: 11
return (importDefault(4656) /* metro dependency 4656 */).filesize(a0);
}
function anyFileTooLarge(a0, a1) { // fn#40189, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4833:3516, offset: 0x010f8eb9, size: 62 bytes, params: 3, frame: 12
const env0_0 = maxFileSize(a1);
const Array = global.Array;
return Array.from(a0).some(_fun40190);
}
function fileUploadLimitRoadblockDescription({guildId, onClick, maxSize}) { // fn#40192, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4833:3835, offset: 0x010f8f31, size: 204 bytes, params: 2, frame: 20
const fileSizeUtilsModule = require(4136) /* metro dependency 4136: FileSizeUtils */;
let formatSize = fileSizeUtilsModule.formatSize;
const value4 = Reflect.apply(formatSize, fileSizeUtilsModule,
[(maxSize ?? maxFileSize(guildId)) / 1024, {useKibibytes: true}]);
const moduleValue2 = fileSizeUtilsModule;
formatSize = moduleValue2.formatSize;
let value = MAX_PREMIUM_TIER_2_ATTACHMENT_SIZE / 1024;
value = Reflect.apply(formatSize, moduleValue2, [value, {useKibibytes: true}]);
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
return intl.format((require(1244) /* metro dependency 1244: indexNative */).t.tRuxk9, {maxSize: value4,
premiumMaxSize: value, onClick: onClick});
}
function _fun40180(a0) { // fn#40180, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4833:2261, offset: 0x010f8bed, size: 104 bytes, params: 2, frame: 14
var r0;
if (a0.reType == null) {
r0 = a0.reName != null && env0_0 !== '';
r0 = r0 && a0.reName.test(env0_0);
} else if (require != null) {
r0 = a0.reType.test(require);
} else {
r0 = a0.reName != null && env0_0 !== '';
r0 = r0 && a0.reName.test(env0_0);
}
return r0;
}
function getGuildMaxFileSize(a0) { // fn#40182, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4833:2600, owner: maxFileSize.getGuildMaxFileSize, offset: 0x010f8ccb, size: 99 bytes, params: 2, frame: 15
const env0_0 = a0;
const FileUploadPowerupHoldoutExperiment = (require(4657) /* metro dependency 4657: FileUploadPowerupHoldoutExperiment */).FileUploadPowerupHoldoutExperiment;
const getConfig = FileUploadPowerupHoldoutExperiment.getConfig;
const env0_1 = Reflect.apply(getConfig, FileUploadPowerupHoldoutExperiment,
[{location: 'getGuildMaxFileSize'}]).enabled;
return env1_9.reduce(_fun40183, MAX_ATTACHMENT_SIZE);
}
function _fun40190({size}) { // fn#40190, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4833:3594, offset: 0x010f8ef7, size: 21 bytes, params: 2, frame: 2
return size > env0_0;
}
function _fun40183(a0, a1) { // fn#40183, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4833:2751, offset: 0x010f8d2e, size: 137 bytes, params: 3, frame: 16
var r0;
var r1;
var r2;
var item3;
var value4;
const value = a0;
const iterator = a1[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
const value2 = undefined;
const value3 = item2 === value2;
const r5 = value3 ? value2 : item;
if (value3) {
r0 = item2;
r1 = value3;
r2 = value2;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value4 = item3 === value2;
if (value4) {
r0 = item3;
r1 = value4;
r2 = value2;
} else {
r0 = item3;
r1 = value4;
r2 = item;
}
}
if (!r1) {
r0.return();
}
return enabled && r5 === GuildFeatures.MAX_FILE_SIZE_250_MB ? value : env0_0.features.has(r5) && r2 > value ? r2 : value;
}
+143
View File
@@ -0,0 +1,143 @@
/* Metro module 8787; source: utils/FriendsUtils.tsx; dependencies: [57, 661, 1244, 44, 683, 8788, 2] */
function _fun68710(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#68710, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8972:6, offset: 0x01c59942, size: 253 bytes, params: 8, frame: 21
const env0_0 = require;
const closure = validateDiscordTag;
const closure2 = humanizeAbortCode;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_4 = constantsModule.AbortCodes;
const env0_5 = constantsModule.AnalyticEvents;
const env0_6 = RegExp('^\\d+$', '');
const env0_7 = RegExp('^(.+?@.+?\\..+?|.+?#\\d{4})$', '');
const env0_8 = RegExp('^[a-zA-Z0-9_\\\\.]+$', '');
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/FriendsUtils.tsx');
exports.validateDiscordTag = closure;
exports.isValidDiscordTag = isValidDiscordTag;
exports.humanizeAbortCode = closure2;
exports.humanizeAbortCodeForA11y = humanizeAbortCodeForA11y;
}
function validateDiscordTag(a0) { // fn#68711, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8972:214, offset: 0x01c59a3f, size: 338 bytes, params: 2, frame: 23
var r0;
var value5;
var property;
var property2;
var defaultImport;
var track;
var FRIEND_REQUEST_FAILED;
var object2;
var length;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
let binding = env0_8;
const value2 = binding.test(a0);
const value3 = null;
if (value2) {
r0 = value3;
} else if (a0.includes('#')) {
binding = env0_7;
if (binding.test(a0)) {
r0 = value3;
} else {
value5 = env0_3(a0.split('#'), 2);
property = value5[0];
property2 = value5[1];
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
track = defaultImport.track;
FRIEND_REQUEST_FAILED = AnalyticEvents.FRIEND_REQUEST_FAILED;
object2 = {reason: 'Invalid Username', query: a0};
length = (value3 != property2 ? property2 : '').length;
object2.discrim_len = length;
length = property.length;
object2.username_len = length;
object2.is_email_like = (importDefault(8788) /* metro dependency 8788: ValidationUtils */).isEmail(a0);
object2.is_invite_like = (importDefault(8788) /* metro dependency 8788: ValidationUtils */).isInvite(a0);
object2.is_num_only = env0_6.test(a0);
Reflect.apply(track, defaultImport, [FRIEND_REQUEST_FAILED, object2]);
r0 = intl.string(t.paDJBM);
}
} else {
value5 = env0_3(a0.split('#'), 2);
property = value5[0];
property2 = value5[1];
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
track = defaultImport.track;
FRIEND_REQUEST_FAILED = AnalyticEvents.FRIEND_REQUEST_FAILED;
object2 = {reason: 'Invalid Username', query: a0};
length = (value3 != property2 ? property2 : '').length;
object2.discrim_len = length;
length = property.length;
object2.username_len = length;
object2.is_email_like = (importDefault(8788) /* metro dependency 8788: ValidationUtils */).isEmail(a0);
object2.is_invite_like = (importDefault(8788) /* metro dependency 8788: ValidationUtils */).isInvite(a0);
object2.is_num_only = env0_6.test(a0);
Reflect.apply(track, defaultImport, [FRIEND_REQUEST_FAILED, object2]);
r0 = intl.string(t.paDJBM);
}
return r0;
}
function humanizeAbortCode(a0, a1) { // fn#68712, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8972:639, offset: 0x01c59b91, size: 608 bytes, params: 3, frame: 16
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const RELATIONSHIP_INCOMING_DISABLED = AbortCodes.RELATIONSHIP_INCOMING_DISABLED;
if (RELATIONSHIP_INCOMING_DISABLED === a0) {
return intl.format(t.Oxe6Ur, {discordTag: a1});
}
const TOO_MANY_FRIENDS = AbortCodes.TOO_MANY_FRIENDS;
if (TOO_MANY_FRIENDS === a0) {
return intl.string(t.tnBalD);
}
const RELATIONSHIP_ALREADY_FRIENDS = AbortCodes.RELATIONSHIP_ALREADY_FRIENDS;
if (RELATIONSHIP_ALREADY_FRIENDS === a0) {
return intl.string(t.VNLneq);
}
const USER_QUARANTINED = AbortCodes.USER_QUARANTINED;
if (USER_QUARANTINED === a0) {
return intl.string(t.EouHwv);
}
const USER_FRIEND_REQUEST_LIMITED_ACCESS = AbortCodes.USER_FRIEND_REQUEST_LIMITED_ACCESS;
if (USER_FRIEND_REQUEST_LIMITED_ACCESS === a0) {
return intl.string(t.EouHwv);
}
const TOO_MANY_BLOCKED_USERS = AbortCodes.TOO_MANY_BLOCKED_USERS;
if (TOO_MANY_BLOCKED_USERS === a0) {
return intl.string(t.sIGo1i);
}
const TOO_MANY_PENDING_OUTGOING = AbortCodes.TOO_MANY_PENDING_OUTGOING;
if (TOO_MANY_PENDING_OUTGOING === a0) {
return intl.string(t.k1K15p);
}
const RELATIONSHIP_INCOMING_BLOCKED = AbortCodes.RELATIONSHIP_INCOMING_BLOCKED;
if (RELATIONSHIP_INCOMING_BLOCKED !== a0) {
if (AbortCodes.RELATIONSHIP_INVALID_SELF !== a0) {
if (AbortCodes.RELATIONSHIP_INVALUD_USER_BOT !== a0) {
AbortCodes.RELATIONSHIP_INVALID_DISCORD_TAG;
}
}
}
return intl.string(t.paDJBM);
}
function isValidDiscordTag(a0) { // fn#68713, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8972:1510, offset: 0x01c59df1, size: 25 bytes, params: 2, frame: 11
return validateDiscordTag(a0) == null;
}
function humanizeAbortCodeForA11y(a0, a1) { // fn#68714, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8972:1641, offset: 0x01c59e0a, size: 145 bytes, params: 3, frame: 18
var r0;
var intl;
const value2 = humanizeAbortCode(a0, a1);
const RELATIONSHIP_INCOMING_DISABLED = AbortCodes.RELATIONSHIP_INCOMING_DISABLED;
if (a0 !== RELATIONSHIP_INCOMING_DISABLED) {
r0 = value2;
} else {
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r0 = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['ihb+UW'],
{discordTag: a1});
}
(importDefault(44) /* metro dependency 44 */)(typeof r0 === 'string', 'abortCode should be a string for a11y');
return r0;
}
+87
View File
@@ -0,0 +1,87 @@
/* Metro module 1944; source: utils/FunctionUtils.tsx; dependencies: [2] */
function _fun21582(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#21582, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2071:6, offset: 0x00ef45fc, size: 122 bytes, params: 8, frame: 17
const closure = function(a0, a1) {
var r0;
var property;
if (a0 !== a1) {
if (a0 == null) {
return false;
}
if (a1 == null) {
return false;
}
var length = a0.length;
if (length !== a1.length) {
return false;
}
length = a0.length;
var value = 0;
if (value < length) {
r0 = value;
loopExit5: while (true) {
property = a0[r0];
if (property !== a1[r0]) {
return false;
}
value = typeof r0 === 'bigint' ? r0 + 1n : +r0 + 1;
if (value < length) {
r0 = value;
continue;
}
break loopExit5;
}
return true;
}
}
return true;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/FunctionUtils.tsx');
exports.areArraysShallowlyEqual = closure;
exports.cachedFunction = function(a0) {
var env0_0 = a0;
var env0_1 = null;
var env0_2 = null;
return _fun21585;
};
exports.clearObject = function(a0) {
var r2;
var propertyName;
var propertyName2;
for (propertyName in a0) {
if (!a0.hasOwnProperty(propertyName)) {
r2 = propertyName2;
continue;
}
delete a0[propertyName];
r2 = propertyName2;
}
};
exports.isPlainObjectEmpty = function(a0) {
var properties = Object.keys(a0);
var properties2 = 0;
var properties3 = properties.length;
if (properties === undefined) {
return true;
}
var propertyName = properties[properties2];
if (properties2 + 1 === undefined) {
return true;
}
return false;
};
}
function cachedFunction(a0) { // fn#21584, offset: 0x00ef46c9, size: 26 bytes, params: 2, frame: 3
const env0_0 = a0;
return _fun21585;
}
function _fun21585(a0) { // fn#21585, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2071:439, offset: 0x00ef46e3, size: 77 bytes, params: 2, frame: 16
const value = copyRestArgs(0, undefined);
env0_2 = !areArraysShallowlyEqual(env0_1, value) ? apply(env0_0, [], undefined, arraySpread([], value, 0,
undefined)) : env0_2;
return env0_2;
}
+41
View File
@@ -0,0 +1,41 @@
/* Metro module 9819; source: utils/GIFPickerUtils.tsx; dependencies: [661, 2] */
function _fun76911(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76911, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10005:6, offset: 0x01de93a4, size: 160 bytes, params: 8, frame: 20
const closure = function(a0) {
return a0 === 'Klipy';
};
const closure2 = function(a0) {
return isKlipyProvider(a0);
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = (require(661) /* metro dependency 661: Constants */).SearchTypes;
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/GIFPickerUtils.tsx');
exports.isKlipyProvider = closure;
exports.shouldUseAnimatedWebPThumbnail = closure2;
exports.getGIFThumbnailForFavorite = function(a0) {
var r0;
var property;
if (shouldUseAnimatedWebPThumbnail(a0.providerName)) {
property = a0.thumbnail;
if (property != null) {
r0 = property.proxyURL ?? property.url;
r0 = r0 ?? property.uri;
return r0;
}
}
};
exports.calculateAnalyticsMetadata = calculateAnalyticsMetadata;
}
function calculateAnalyticsMetadata(a0, a1, a2) { // fn#76915, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10005:630, offset: 0x01de9495, size: 209 bytes, params: 4, frame: 19
let value = a2;
const value2 = null;
const r1 = value2 != a1 ? {[a1]: 1} : {};
const {offset, limit, results, totalResults} = value2 != value ? value : {};
const GIF = SearchTypes.GIF;
value = 1;
const Object = global.Object;
return {search_type: GIF, load_id: a0, limit: limit, offset: offset,
page: value2 != limit && value2 != offset ? global.Math.floor(offset / limit) + value : value, total_results: totalResults, page_results: value2 != results ? results : value2, num_modifiers: Object.keys(r1).length, modifiers: r1};
}
+48
View File
@@ -0,0 +1,48 @@
/* Metro module 6871; source: utils/GameUtils.native.tsx; dependencies: [2] */
function _fun54401(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#54401, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7049:6, offset: 0x01364b99, size: 232 bytes, params: 8, frame: 16
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/GameUtils.native.tsx');
exports.default = {waitSubscribed: function() {
var Promise = global.Promise;
return Promise.resolve();
}, waitParentSubscribed: function() {
var Promise = global.Promise;
return Promise.resolve();
}, waitConnected: function() {
var Promise = global.Promise;
return Promise.resolve();
}, waitParentConnected: function() {
var Promise = global.Promise;
return Promise.resolve();
}, isLaunchable: function() {
var Promise = global.Promise;
return Promise.resolve(false);
}, isGameLaunchable: function() {
var Promise = global.Promise;
return Promise.resolve(false);
}, launch: function() {
var Promise = global.Promise;
var Error = global.Error;
return Promise.reject(new Error('not supported'));
}, launchDispatchApplication: function() {
var Promise = global.Promise;
var Error = global.Error;
return Promise.reject(new Error('not supported'));
}, removeShortcuts: function() {
var Promise = global.Promise;
return Promise.resolve(false);
}, createShortcuts: function() {
var Promise = global.Promise;
return Promise.resolve(false);
}, launchGame: function() {
var Promise = global.Promise;
var Error = global.Error;
return Promise.reject(new Error('not supported'));
}, isProtocolRegistered: function() {
var Promise = global.Promise;
return Promise.resolve(false);
}, setRecentGames: function() {
}};
}
File diff suppressed because it is too large. Load diff
+34
View File
@@ -0,0 +1,34 @@
/* Metro module 1360; source: utils/GlobalUtils.tsx; dependencies: [2] */
function _fun15586(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#15586, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1487:6, offset: 0x00e36c4f, size: 185 bytes, params: 8, frame: 17
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const GLOBAL_ENV = global.window.GLOBAL_ENV;
const PROJECT_ENV = GLOBAL_ENV.PROJECT_ENV;
const result = PROJECT_ENV === 'development';
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/GlobalUtils.tsx');
exports.isDiscordFrontendDevelopment = function() {
return false;
};
exports.isDiscordBackendDevelopment = function() {
return result;
};
exports.assertNever = function(a0) {
var Error = global.Error;
var value = 'Unhandled value: ' + a0;
value = new Error(value);
throw value;
};
exports.isNotNullish = function(a0) {
return a0 != null;
};
exports.isIn = function(a0, a1) {
return a1.includes(a0);
};
exports.isInSet = function(a0, a1) {
return a1.has(a0);
};
exports.isObjectEntryNotNullish = function(a0) {
return a0[1] != null;
};
}
File diff suppressed because it is too large. Load diff
+874
View File
@@ -0,0 +1,874 @@
/* Metro module 6946; source: utils/GuildDiscoveryUtils.tsx; dependencies: [5, 3785, 4111, 1867, 661, 1230, 6947, 6837, 6593, 6912, 6914, 683, 507, 1468, 2] */
function _fun55237(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#55237, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7124:6, offset: 0x01379581, size: 502 bytes, params: 8, frame: 20
const env0_0 = require;
const closure = makeDiscoverableGuild;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
const lurkingStore = importDefault(3785) /* metro dependency 3785: LurkingStore */;
const guildMemberCountStore = importDefault(4111) /* metro dependency 4111: GuildMemberCountStore */;
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_7 = constantsModule.AnalyticEvents;
const env0_8 = constantsModule.SearchTypes;
const env0_9 = constantsModule.Endpoints;
const env0_10 = constantsModule.Routes;
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/GuildDiscoveryUtils.tsx');
exports.AnalyticsContexts = {SEARCH: 'Search', RECOMMENDED: 'Recommended', POPULAR: 'Popular',
RECOMMENDED_E3: 'Recommended - E3', HEADER: 'Header', GLOBAL_DISCOVERY: 'Global Discovery',
FORWARD_BREADCRUMB: 'Forward Breadcrumb'};
exports.IOS_MINIMUM_MEMBER_COUNT = '>1000';
exports.MINIMUM_MEMBER_COUNT = '>200';
exports.startLurking = function() {
return _startLurking.apply(this, arguments);
};
exports.makeDiscoverableGuild = closure;
exports.trackDiscoveryExited = trackDiscoveryExited;
exports.trackSearchClosed = function(a0) {
var defaultImport = importDefault(dependencyMap[11]);
var SEARCH_CLOSED = AnalyticEvents.SEARCH_CLOSED;
defaultImport.track(SEARCH_CLOSED, {load_id: a0});
};
exports.trackSearchStarted = trackSearchStarted;
exports.trackGuildDiscoverySearchStart = function({withCounts, offset}) {
var defaultImport = importDefault(dependencyMap[11]);
var GUILD_DISCOVERY_SEARCH_START = AnalyticEvents.GUILD_DISCOVERY_SEARCH_START;
defaultImport.track(GUILD_DISCOVERY_SEARCH_START, {with_counts: withCounts, offset: offset});
};
exports.trackSearchFailed = function({categoryId, error, willRequestRetry, isRequestRetry}) {
var defaultImport = importDefault(dependencyMap[11]);
var GUILD_DISCOVERY_SEARCH_FAILED = AnalyticEvents.GUILD_DISCOVERY_SEARCH_FAILED;
defaultImport.track(GUILD_DISCOVERY_SEARCH_FAILED, {category_id: categoryId, request_status: error.status,
request_error_code: error.code, will_request_retry: willRequestRetry, is_request_retry: isRequestRetry});
};
exports.trackGuildDiscoveryGetFeaturedGuildsFailed = function({categoryId}) {
var defaultImport = importDefault(dependencyMap[11]);
var GUILD_DISCOVERY_GET_FEATURED_GUILDS_FAILED = AnalyticEvents.GUILD_DISCOVERY_GET_FEATURED_GUILDS_FAILED;
defaultImport.track(GUILD_DISCOVERY_GET_FEATURED_GUILDS_FAILED, {category_id: categoryId});
};
exports.trackSearchResultsViewed = trackSearchResultsViewed;
exports.trackGuildJoinClicked = function(a0) {
var value2 = LurkingStore.getLoadId(a0);
var defaultImport = importDefault(dependencyMap[11]);
var GUILD_DISCOVERY_GUILD_JOIN_CLICKED = AnalyticEvents.GUILD_DISCOVERY_GUILD_JOIN_CLICKED;
var object = {guild_id: a0, load_id: value2};
object.guild_size = GuildMemberCountStore.getMemberCount(a0);
defaultImport.track(GUILD_DISCOVERY_GUILD_JOIN_CLICKED, object);
};
exports.getDiscoverableGuild = function() {
return _getDiscoverableGuild.apply(this, arguments);
};
exports.fetchPublicDiscoveryGuild = function() {
return _fetchPublicDiscoveryGuild.apply(this, arguments);
};
}
function _startLurking() { // fn#55238, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7124:436, offset: 0x01379777, size: 48 bytes, params: 1, frame: 14
return env0_3(_fun55240).apply(this, arguments);
}
function makeDiscoverableGuild({id, name, description, splash, banner, icon, features, approximate_presence_count, approximate_member_count, premium_subscription_count, preferred_locale, discovery_splash, emojis, emoji_count, stickers, sticker_count, keywords}) { // fn#55241, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7124:1477, offset: 0x01379ad2, size: 218 bytes, params: 2, frame: 13
const object2 = {};
object2.id = id;
object2.name = name;
object2.description = description;
object2.splash = splash;
object2.banner = banner;
object2.icon = icon;
const Set = global.Set;
object2.features = new Set(features);
object2.presenceCount = approximate_presence_count;
object2.memberCount = approximate_member_count;
object2.premiumSubscriptionCount = premium_subscription_count;
object2.preferredLocale = preferred_locale;
object2.discoverySplash = discovery_splash;
object2.emojis = emojis;
object2.emojiCount = emoji_count;
object2.stickers = stickers;
object2.stickerCount = sticker_count;
object2.keywords = keywords;
return object2;
}
function _getDiscoverableGuild() { // fn#55242, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7124:1954, offset: 0x01379bac, size: 48 bytes, params: 1, frame: 14
return env0_3(_fun55244).apply(this, arguments);
}
function _fetchPublicDiscoveryGuild() { // fn#55245, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7124:2308, offset: 0x01379cc3, size: 48 bytes, params: 1, frame: 14
return env0_3(_fun55247).apply(this, arguments);
}
function trackDiscoveryExited(a0, a1) { // fn#55249, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7124:2973, offset: 0x01379dd4, size: 84 bytes, params: 3, frame: 16
const value = a2;
const r5 = value !== undefined ? value : null;
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const GUILD_DISCOVERY_EXITED = AnalyticEvents.GUILD_DISCOVERY_EXITED;
Reflect.apply(track, defaultImport, [GUILD_DISCOVERY_EXITED, {load_id: a0, guild_ids_viewed: a1,
recommendations_source: r5}]);
}
function trackSearchStarted(a0, a1) { // fn#55251, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7124:3231, offset: 0x01379e62, size: 99 bytes, params: 3, frame: 16
const value = a2;
const r5 = value !== undefined ? value : {};
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const SEARCH_STARTED = AnalyticEvents.SEARCH_STARTED;
const GUILD_DISCOVERY = SearchTypes.GUILD_DISCOVERY;
Reflect.apply(track, defaultImport, [SEARCH_STARTED, {search_type: GUILD_DISCOVERY, load_id: a0,
location: r5.location, category_id: a1}]);
}
function trackSearchResultsViewed({loadId, searchId, query, guildResults, analyticsContext, categoryId, isTagSearch}) { // fn#55255, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7124:4034, offset: 0x01379fcb, size: 202 bytes, params: 2, frame: 23
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const SEARCH_RESULT_VIEWED = AnalyticEvents.SEARCH_RESULT_VIEWED;
const object2 = {};
object2.search_type = isTagSearch ? SearchTypes.GUILD_DISCOVERY_TAG : SearchTypes.GUILD_DISCOVERY;
object2.load_id = loadId;
object2.search_id = searchId;
const value = guildResults !== undefined;
object2.total_results = value ? guildResults.length : null;
object2.guild_ids = value ? guildResults.map(function(a0) {
return a0.id;
}) : null;
object2.query = query;
object2.location = analyticsContext.location;
object2.category_id = categoryId;
Reflect.apply(track, defaultImport, [SEARCH_RESULT_VIEWED, object2]);
}
async function _fun55240(a0, a1) { // fn#55240, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7124:485, offset: 0x013797b9, size: 793 bytes, params: 3, frame: 31
var r16;
var value9;
var value11;
var transitionToGuildSync;
var object2;
var object3;
var value16;
var object7;
let value = a2;
if (false) {
return undefined;
}
const value4 = undefined;
const r6 = value !== value4 ? value : {};
await value4;
if (false) {
return undefined;
}
const channelId = r6.channelId;
const onSuccess = r6.onSuccess;
const joinSource = r6.joinSource;
const loadId = r6.loadId;
const shouldNavigate = r6.shouldNavigate;
const r9 = value4 === shouldNavigate || shouldNavigate;
value = environment.__proto__.__proto__;
let binding = env2_0;
const history = binding(env2_2[5]).getHistory();
const guild = env2_6.getGuild(a0);
const object8 = {sourceLocationStack: a3};
object8.state = {analyticsSource: a1};
if (guild == null) {
if (guild == null) {
r16 = a3 == null ? value4 : a3[a3.length - 1];
r16 = r16 ?? (a1 == null ? value4 : a1.page);
binding = env2_0;
value9 = binding(env2_2[9]);
if (value9.getMobileLurkerServerPreview('startLurking').enabled) {
env2_0(env2_2[10]).trackLurkStarted(a0, joinSource, r16);
}
binding = env2_1;
value11 = binding(env2_2[8]);
await value11.joinGuild(a0, {lurker: true, source: joinSource, loadId: loadId, lurkLocation: r16});
if (false) {
return undefined;
}
if (r9) {
value = env2_1(env2_2[8]);
transitionToGuildSync = value.transitionToGuildSync;
object2 = {};
copyDataProperties(object2, object8, undefined);
object2['welcomeModalChannelId'] = channelId;
object2['navigationReplace'] = channelId != null;
object2['openChannel'] = channelId != null;
object2['search'] = history.location.search;
await Reflect.apply(transitionToGuildSync, value, [a0, object2, channelId, r6.messageId]);
value = undefined;
if (false) {
return value;
}
if (onSuccess != null) {
onSuccess();
}
return value4;
}
if (onSuccess != null) {
onSuccess();
}
return value4;
}
binding = env2_4;
if (binding.isLurking(a0)) {
if (r9) {
value = env2_1(env2_2[8]);
transitionToGuildSync = value.transitionToGuildSync;
object3 = {};
copyDataProperties(object3, object8, undefined);
object3['welcomeModalChannelId'] = channelId;
object3['navigationReplace'] = channelId != null;
object3['openChannel'] = channelId != null;
object3['search'] = history.location.search;
await Reflect.apply(transitionToGuildSync, value, [a0, object3, channelId, r6.messageId]);
value = undefined;
if (false) {
return value;
}
if (onSuccess != null) {
onSuccess();
}
return value4;
}
if (onSuccess != null) {
onSuccess();
}
return value4;
}
r16 = a3 == null ? value4 : a3[a3.length - 1];
r16 = r16 ?? (a1 == null ? value4 : a1.page);
binding = env2_0;
value9 = binding(env2_2[9]);
if (value9.getMobileLurkerServerPreview('startLurking').enabled) {
env2_0(env2_2[10]).trackLurkStarted(a0, joinSource, r16);
}
binding = env2_1;
value11 = binding(env2_2[8]);
} else {
if (guild.joinedAt != null) {
if (r9) {
if (channelId == null) {
env2_0(env2_2[6]).transitionToGuild(a0, object8);
} else {
binding = env2_1;
value16 = binding(env2_2[7]);
binding = env2_10;
value = binding.CHANNEL(a0, channelId, r6.messageId);
object7 = {};
copyDataProperties(object7, object8, undefined);
object7['navigationReplace'] = true;
object7['openChannel'] = true;
value16(value, object7);
}
}
if (onSuccess != null) {
onSuccess();
}
return value4;
}
if (guild == null) {
r16 = a3 == null ? value4 : a3[a3.length - 1];
r16 = r16 ?? (a1 == null ? value4 : a1.page);
binding = env2_0;
value9 = binding(env2_2[9]);
if (value9.getMobileLurkerServerPreview('startLurking').enabled) {
env2_0(env2_2[10]).trackLurkStarted(a0, joinSource, r16);
}
binding = env2_1;
value11 = binding(env2_2[8]);
await value11.joinGuild(a0, {lurker: true, source: joinSource, loadId: loadId, lurkLocation: r16});
if (false) {
return undefined;
}
if (r9) {
value = env2_1(env2_2[8]);
transitionToGuildSync = value.transitionToGuildSync;
object2 = {};
copyDataProperties(object2, object8, undefined);
object2['welcomeModalChannelId'] = channelId;
object2['navigationReplace'] = channelId != null;
object2['openChannel'] = channelId != null;
object2['search'] = history.location.search;
await Reflect.apply(transitionToGuildSync, value, [a0, object2, channelId, r6.messageId]);
value = undefined;
if (false) {
return value;
}
if (onSuccess != null) {
onSuccess();
}
return value4;
}
if (onSuccess != null) {
onSuccess();
}
return value4;
}
binding = env2_4;
if (binding.isLurking(a0)) {
if (r9) {
value = env2_1(env2_2[8]);
transitionToGuildSync = value.transitionToGuildSync;
object3 = {};
copyDataProperties(object3, object8, undefined);
object3['welcomeModalChannelId'] = channelId;
object3['navigationReplace'] = channelId != null;
object3['openChannel'] = channelId != null;
object3['search'] = history.location.search;
await Reflect.apply(transitionToGuildSync, value, [a0, object3, channelId, r6.messageId]);
value = undefined;
if (false) {
return value;
}
if (onSuccess != null) {
onSuccess();
}
return value4;
}
if (onSuccess != null) {
onSuccess();
}
return value4;
}
r16 = a3 == null ? value4 : a3[a3.length - 1];
r16 = r16 ?? (a1 == null ? value4 : a1.page);
value9 = env2_0(env2_2[9]);
if (value9.getMobileLurkerServerPreview('startLurking').enabled) {
env2_0(env2_2[10]).trackLurkStarted(a0, joinSource, r16);
}
value11 = env2_1(env2_2[8]);
}
await value11.joinGuild(a0, {lurker: true, source: joinSource, loadId: loadId, lurkLocation: r16});
if (false) {
return undefined;
}
if (r9) {
value = env2_1(env2_2[8]);
transitionToGuildSync = value.transitionToGuildSync;
object2 = {};
copyDataProperties(object2, object8, undefined);
object2['welcomeModalChannelId'] = channelId;
object2['navigationReplace'] = channelId != null;
object2['openChannel'] = channelId != null;
object2['search'] = history.location.search;
await Reflect.apply(transitionToGuildSync, value, [a0, object2, channelId, r6.messageId]);
value = undefined;
if (false) {
return value;
}
}
if (onSuccess != null) {
onSuccess();
}
return value4;
}
function* _fun55244(a0) { // fn#55244, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7124:2019, offset: 0x01379be5, size: 222 bytes, params: 2, frame: 20
var r4;
var r2;
var binding;
var binding2;
var property;
var value4;
var HTTP;
var get;
var object3;
var GUILD_DISCOVERY;
var value5;
var stringify;
var object4;
var value6;
var value7;
var value8;
var value9;
var body;
var value10;
var guilds;
var value11;
var value12;
var error;
if (false) {
return undefined;
}
value = undefined;
try {
binding = env2_0;
} catch (error) {
return null;
}
try {
binding2 = env2_2;
} catch (error) {
return null;
}
try {
property = binding2[12];
} catch (error) {
return null;
}
try {
value4 = binding(property);
} catch (error) {
return null;
}
try {
HTTP = value4.HTTP;
} catch (error) {
return null;
}
try {
get = HTTP.get;
} catch (error) {
return null;
}
try {
object3 = {};
} catch (error) {
return null;
}
try {
binding = env2_9;
} catch (error) {
return null;
}
try {
GUILD_DISCOVERY = binding.GUILD_DISCOVERY;
} catch (error) {
return null;
}
try {
object3.url = GUILD_DISCOVERY;
} catch (error) {
return null;
}
try {
binding = env2_1;
} catch (error) {
return null;
}
try {
property = binding2[13];
} catch (error) {
return null;
}
try {
value5 = binding(property);
} catch (error) {
return null;
}
try {
stringify = value5.stringify;
} catch (error) {
return null;
}
try {
object4 = {};
} catch (error) {
return null;
}
try {
object4.guild_ids = a0;
} catch (error) {
return null;
}
try {
value6 = Reflect.apply(stringify, value5, [object4]);
} catch (error) {
return null;
}
try {
object3.query = value6;
} catch (error) {
return null;
}
try {
object3.oldFormErrors = true;
} catch (error) {
return null;
}
try {
object3.rejectWithError = true;
} catch (error) {
return null;
}
try {
value7 = Reflect.apply(get, HTTP, [object3]);
} catch (error) {
return null;
}
yield value7;
try {
value8 = undefined;
value9 = false;
} catch (error) {
return null;
}
if (value9) {
return value8;
}
try {
body = value8.body;
} catch (error) {
return null;
}
try {
value10 = body == null;
} catch (error) {
return null;
}
if (value10) {
r4 = value;
} else {
try {
guilds = body.guilds;
} catch (error) {
return null;
}
try {
value11 = guilds == null;
} catch (error) {
return null;
}
if (value11) {
r4 = value;
} else {
try {
property = guilds[0];
} catch (error) {
return null;
}
r4 = property;
}
}
try {
value12 = r4 == null;
} catch (error) {
return null;
}
if (value12) {
r2 = r4;
} else {
try {
binding = env2_12;
} catch (error) {
return null;
}
try {
value = binding(r4);
} catch (error) {
return null;
}
r2 = value;
}
return r2;
}
function* _fun55247(a0) { // fn#55247, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7124:2383, offset: 0x01379cfc, size: 216 bytes, params: 2, frame: 18
var guild;
var slug;
var r2;
var binding;
var binding2;
var property;
var value4;
var HTTP;
var get;
var object2;
var GUILD_DISCOVERY_SLUG;
var String;
var value5;
var value6;
var value7;
var value8;
var value9;
var body;
var value11;
var value12;
var value13;
var error;
if (false) {
return undefined;
}
value = undefined;
try {
binding = env2_0;
} catch (error) {
return null;
}
try {
binding2 = env2_2;
} catch (error) {
return null;
}
try {
property = binding2[12];
} catch (error) {
return null;
}
try {
value4 = binding(property);
} catch (error) {
return null;
}
try {
HTTP = value4.HTTP;
} catch (error) {
return null;
}
try {
get = HTTP.get;
} catch (error) {
return null;
}
try {
object2 = {'url': null, 'oldFormErrors': true, 'rejectWithError': true};
} catch (error) {
return null;
}
try {
binding = env2_9;
} catch (error) {
return null;
}
try {
GUILD_DISCOVERY_SLUG = binding.GUILD_DISCOVERY_SLUG;
} catch (error) {
return null;
}
try {
String = global.String;
} catch (error) {
return null;
}
try {
value5 = String(a0);
} catch (error) {
return null;
}
try {
value6 = Reflect.apply(GUILD_DISCOVERY_SLUG, binding, [value5]);
} catch (error) {
return null;
}
try {
object2.url = value6;
} catch (error) {
return null;
}
try {
value7 = Reflect.apply(get, HTTP, [object2]);
} catch (error) {
return null;
}
yield value7;
try {
value8 = undefined;
value9 = false;
} catch (error) {
return null;
}
if (value9) {
return value8;
}
try {
body = value8.body;
} catch (error) {
return null;
}
const value10 = null;
try {
value11 = value10 == body;
} catch (error) {
return null;
}
if (value11) {
guild = value;
try {
value12 = value10 == guild;
} catch (error) {
return null;
}
if (value12) {
return value10;
}
try {
value13 = value10 == body;
} catch (error) {
return null;
}
if (value13) {
slug = value;
try {
value = value10 == slug;
} catch (error) {
return null;
}
if (value) {
return value10;
}
try {
object2 = {};
} catch (error) {
return null;
}
try {
guild = body.guild;
} catch (error) {
return null;
}
try {
object2.guild = guild;
} catch (error) {
return null;
}
try {
slug = body.slug;
} catch (error) {
return null;
}
try {
object2.slug = slug;
r2 = object2;
} catch (error) {
return null;
}
return r2;
}
try {
slug = body.slug;
} catch (error) {
return null;
}
try {
value = value10 == slug;
} catch (error) {
return null;
}
if (value) {
return value10;
}
try {
object2 = {};
} catch (error) {
return null;
}
try {
guild = body.guild;
} catch (error) {
return null;
}
try {
object2.guild = guild;
} catch (error) {
return null;
}
try {
slug = body.slug;
} catch (error) {
return null;
}
try {
object2.slug = slug;
r2 = object2;
} catch (error) {
return null;
}
} else {
try {
guild = body.guild;
} catch (error) {
return null;
}
try {
value12 = value10 == guild;
} catch (error) {
return null;
}
if (value12) {
return value10;
}
try {
value13 = value10 == body;
} catch (error) {
return null;
}
if (value13) {
slug = value;
try {
value = value10 == slug;
} catch (error) {
return null;
}
if (value) {
return value10;
}
try {
object2 = {};
} catch (error) {
return null;
}
try {
guild = body.guild;
} catch (error) {
return null;
}
try {
object2.guild = guild;
} catch (error) {
return null;
}
try {
slug = body.slug;
} catch (error) {
return null;
}
try {
object2.slug = slug;
r2 = object2;
} catch (error) {
return null;
}
return r2;
}
try {
slug = body.slug;
} catch (error) {
return null;
}
try {
value = value10 == slug;
} catch (error) {
return null;
}
if (value) {
return value10;
}
try {
object2 = {};
} catch (error) {
return null;
}
try {
guild = body.guild;
} catch (error) {
return null;
}
try {
object2.guild = guild;
} catch (error) {
return null;
}
try {
slug = body.slug;
} catch (error) {
return null;
}
try {
object2.slug = slug;
r2 = object2;
} catch (error) {
return null;
}
}
return r2;
}
+543
View File
@@ -0,0 +1,543 @@
/* Metro module 1418; source: utils/GuildRecordUtils.tsx; dependencies: [1419, 1422, 661, 1421, 44, 1866, 2] */
function _fun16554(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#16554, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:6, offset: 0x00e529e5, size: 425 bytes, params: 8, frame: 20
const env0_0 = require;
const closure = fromGuildPropertiesWithAdditionalFields;
const closure2 = function(a0) {
var constructGuildInPlaceBinding = constructGuildInPlace;
var object = {};
copyDataProperties(object, GUILD_DEFAULT_PROPERTY_VALUES, constructGuildInPlaceBinding);
copyDataProperties(object, a0, constructGuildInPlaceBinding);
return constructGuildInPlaceBinding(object);
};
const constructGuildInPlace = function(a0) {
return constructInPlace(GuildRecordTypeTag, a0);
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = require(1419) /* metro dependency 1419: PlainRecord */;
const env0_3 = value.constructInPlace;
const env0_4 = value.merge;
const env0_5 = value.objectIsPlainRecordOfType;
const env0_6 = value.tryReuseExistingInPlacePlainRecord;
value = require(1422) /* metro dependency 1422: GuildRecord */;
const env0_7 = value.GUILD_DEFAULT_PROPERTY_VALUES;
const env0_8 = value.GuildRecordTypeTag;
const env0_9 = (require(661) /* metro dependency 661: Constants */).GuildNSFWContentLevel;
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/GuildRecordUtils.tsx');
exports.isGuildRecord = function(a0) {
return objectIsPlainRecordOfType(GuildRecordTypeTag, a0);
};
exports.fromGuildPropertiesWithAdditionalFields = closure;
exports.fromServer = fromServer;
exports.attachSerializedData = attachSerializedData;
exports.fromBackgroundSync = fromBackgroundSync;
exports.fromGuild = fromGuild;
exports.fromInviteGuild = fromInviteGuild;
exports.fromGuildProfile = fromGuildProfile;
exports.fromStoreListingGuild = fromStoreListingGuild;
exports.fromDirectoryGuild = fromDirectoryGuild;
exports.fromGuildDirectoryEntry = fromGuildDirectoryEntry;
exports.fromVerificationGateGuild = fromVerificationGateGuild;
exports.fromClientDiscoverableGuild = fromClientDiscoverableGuild;
exports.fromGuildBasic = fromGuildBasic;
exports.dangerouslyConstructGuildRecordFromUntypedObject = dangerouslyConstructGuildRecordFromUntypedObject;
exports.toGuildProperties = toGuildProperties;
exports.fromSerializedGuildRecord = fromSerializedGuildRecord;
exports.constructFromPartialGuildRecord = closure2;
}
function fromGuildPropertiesWithAdditionalFields(a0, {joinedAt, premiumSubscriberCount}, a2) { // fn#16555, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:305, offset: 0x00e52b8e, size: 1083 bytes, params: 4, frame: 22
var date;
const tryReuseExistingInPlacePlainRecordBinding = tryReuseExistingInPlacePlainRecord;
const object2 = {};
object2.id = a0.id;
object2.joinedAt = joinedAt;
object2.premiumSubscriberCount = premiumSubscriberCount;
object2.name = a0.name;
object2.description = a0.description ?? null;
object2.icon = a0.icon ?? null;
object2.splash = a0.splash ?? null;
object2.banner = a0.banner ?? null;
object2.homeHeader = a0.home_header ?? null;
const setUtilsModule = require(1421) /* metro dependency 1421: SetUtils */;
object2.features = setUtilsModule.toSetInplace(a0.features);
let r8 = a0.preferred_locale ?? GUILD_DEFAULT_PROPERTY_VALUES.preferredLocale;
object2.preferredLocale = r8;
object2.ownerId = a0.owner_id;
object2.application_id = a0.application_id ?? null;
object2.afkChannelId = a0.afk_channel_id ?? null;
object2.afkTimeout = a0.afk_timeout ?? GUILD_DEFAULT_PROPERTY_VALUES.afkTimeout;
object2.systemChannelId = a0.system_channel_id ?? null;
object2.verificationLevel = a0.verification_level ?? GUILD_DEFAULT_PROPERTY_VALUES.verificationLevel;
object2.explicitContentFilter = a0.explicit_content_filter ?? GUILD_DEFAULT_PROPERTY_VALUES.explicitContentFilter;
object2.defaultMessageNotifications = a0.default_message_notifications;
object2.mfaLevel = a0.mfa_level ?? GUILD_DEFAULT_PROPERTY_VALUES.mfaLevel;
object2.vanityURLCode = a0.vanity_url_code ?? null;
object2.premiumTier = a0.premium_tier ?? GUILD_DEFAULT_PROPERTY_VALUES.premiumTier;
object2.premiumProgressBarEnabled = a0.premium_progress_bar_enabled || GUILD_DEFAULT_PROPERTY_VALUES.premiumProgressBarEnabled;
if (a0.premium_progress_bar_enabled_user_updated_at != null) {
date = new global.Date(a0.premium_progress_bar_enabled_user_updated_at);
} else {
r8 = null;
}
object2.premiumProgressBarEnabledUserUpdatedAt = r8;
object2.systemChannelFlags = a0.system_channel_flags;
object2.discoverySplash = a0.discovery_splash ?? null;
object2.rulesChannelId = a0.rules_channel_id ?? null;
object2.safetyAlertsChannelId = a0.safety_alerts_channel_id ?? null;
object2.publicUpdatesChannelId = a0.public_updates_channel_id ?? null;
object2.maxStageVideoChannelUsers = a0.max_stage_video_channel_users ?? GUILD_DEFAULT_PROPERTY_VALUES.maxStageVideoChannelUsers;
object2.maxVideoChannelUsers = a0.max_video_channel_users ?? GUILD_DEFAULT_PROPERTY_VALUES.maxVideoChannelUsers;
object2.maxMembers = a0.max_members ?? GUILD_DEFAULT_PROPERTY_VALUES.maxMembers;
object2.nsfwLevel = a0.nsfw_level ?? GUILD_DEFAULT_PROPERTY_VALUES.nsfwLevel;
object2.ownerConfiguredContentLevel = a0.owner_configured_content_level ?? null;
object2.hubType = a0.hub_type ?? null;
object2.latestOnboardingQuestionId = a0.latest_onboarding_question_id ?? null;
object2.profile = a0.profile ?? null;
object2.guildTheme = resolveGuildTheme(a0.theme, a2);
object2.premiumFeatures = a0.premium_features != null ? {features: a0.premium_features.features,
additionalEmojiSlots: a0.premium_features.additional_emoji_slots,
additionalStickerSlots: a0.premium_features.additional_sticker_slots,
additionalSoundSlots: a0.premium_features.additional_sound_slots} : null;
object2.moderatorReporting = a0.moderator_reporting != null ? {moderatorReportingEnabled: a0.moderator_reporting.moderator_reporting_enabled,
moderatorReportChannelId: a0.moderator_reporting.moderator_report_channel_id} : null;
object2.verificationRoleId = a0.verification_role_id ?? null;
object2.gameApplicationIds = a0.game_application_ids ?? null;
object2.officialMessageColor = a0.official_message_color ?? null;
return tryReuseExistingInPlacePlainRecordBinding(GuildRecordTypeTag, a2, object2);
}
function resolveGuildTheme(a0, a1) { // fn#16558, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:3199, offset: 0x00e53008, size: 110 bytes, params: 3, frame: 16
var r0;
var guildTheme;
var value2;
var value4;
let value = undefined;
if (value === a0) {
value4 = null;
guildTheme = value4 == a1 ? value : a1.guildTheme;
r0 = value4 != guildTheme ? guildTheme : value4;
} else {
value2 = null;
if (value2 != a0) {
value = require(1866) /* metro dependency 1866: guildThemeSerialization */;
value = value.fromServerGuildTheme(a0);
r0 = value2 != value ? value : {'enabled': false, 'themeSettings': null};
} else {
r0 = value2;
}
}
return r0;
}
function fromServer(a0, a1) { // fn#16560, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:3603, offset: 0x00e5308e, size: 210 bytes, params: 3, frame: 19
var joinedAt;
var r6;
var r0;
var date;
const joined_at = a0.joined_at;
let value = null;
if (value != joined_at) {
date = new global.Date(a0.joined_at);
} else {
joinedAt = value == a1 ? undefined : a1.joinedAt;
r6 = value != joinedAt ? joinedAt : value;
}
const premium_subscription_count = a0.premium_subscription_count;
const r5 = value != premium_subscription_count ? premium_subscription_count : 0;
if (value == a0.properties) {
(importDefault(44) /* metro dependency 44 */)(value != a1,
'If guild.properties is null, existingGuild must be passed in');
value = merge(a1, {joinedAt: r6, premiumSubscriberCount: r5});
r0 = value;
} else {
r0 = fromGuildPropertiesWithAdditionalFields(a0.properties, {joinedAt: r6, premiumSubscriberCount: r5}, a1);
}
return r0;
}
function attachSerializedData(a0, a1, a2) { // fn#16561, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:4035, offset: 0x00e53160, size: 190 bytes, params: 4, frame: 16
const object2 = {};
copyDataProperties(object2, a0, undefined);
const joinedAt = a0.joinedAt;
const value = null;
object2['joinedAt'] = value != joinedAt ? a0.joinedAt.toISOString() : value;
object2['premiumProgressBarEnabledUserUpdatedAt'] = value != a0.premiumProgressBarEnabledUserUpdatedAt ? a0.premiumProgressBarEnabledUserUpdatedAt.toISOString() : value;
const Array = global.Array;
object2['features'] = Array.from(a0.features);
object2['roles'] = a1;
object2['member'] = value != a2 ? {userId: a2.userId, roles: a2.roles} : value;
return object2;
}
function fromBackgroundSync(a0, a1) { // fn#16562, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:4401, offset: 0x00e5321e, size: 69 bytes, params: 3, frame: 16
var r0;
let value = a1;
if (a0.properties == null) {
r0 = value;
} else {
value = fromGuildPropertiesWithAdditionalFields(a0.properties, {joinedAt: value.joinedAt,
premiumSubscriberCount: value.premiumSubscriberCount}, value);
r0 = value;
}
return r0;
}
function fromGuild(a0, a1) { // fn#16563, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:4601, offset: 0x00e53263, size: 117 bytes, params: 3, frame: 18
const fromGuildPropertiesWithAdditionalFieldsBinding = fromGuildPropertiesWithAdditionalFields;
const joined_at = a0.joined_at;
const value = null;
return fromGuildPropertiesWithAdditionalFieldsBinding(a0,
{joinedAt: value != joined_at ? new global.Date(a0.joined_at) : value != (value == a1 ? undefined : a1.joinedAt) ? value == a1 ? undefined : a1.joinedAt : value,
premiumSubscriberCount: a0.premium_subscription_count}, a1);
}
function fromInviteGuild({id, name, description, icon, splash, banner, features, verification_level, vanity_url_code, premium_subscription_count, nsfw_level, premium_tier, home_header}) { // fn#16564, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:4848, offset: 0x00e532d8, size: 187 bytes, params: 2, frame: 15
const constructFromPartialGuildRecordBinding = constructFromPartialGuildRecord;
const object2 = {};
object2.id = id;
object2.name = name;
object2.description = description;
object2.icon = icon;
object2.splash = splash;
object2.banner = banner;
object2.features = (require(1421) /* metro dependency 1421: SetUtils */).toSetInplace(features);
object2.verificationLevel = verification_level;
object2.vanityURLCode = vanity_url_code;
object2.premiumSubscriberCount = premium_subscription_count;
object2.nsfwLevel = nsfw_level;
object2.premiumTier = premium_tier;
object2.homeHeader = home_header;
return constructFromPartialGuildRecordBinding(object2);
}
function fromGuildProfile({id, name, description, icon, premiumSubscriberCount, premiumTier, features}) { // fn#16565, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:5268, offset: 0x00e53393, size: 151 bytes, params: 2, frame: 15
const constructFromPartialGuildRecordBinding = constructFromPartialGuildRecord;
const object2 = {};
object2.id = id;
object2.name = name;
object2.description = description;
object2.icon = icon;
premiumSubscriberCount = premiumSubscriberCount ?? GUILD_DEFAULT_PROPERTY_VALUES.premiumSubscriberCount;
object2.premiumSubscriberCount = premiumSubscriberCount;
premiumTier = premiumTier ?? GUILD_DEFAULT_PROPERTY_VALUES.premiumTier;
object2.premiumTier = premiumTier;
object2.features = (require(1421) /* metro dependency 1421: SetUtils */).toSetInplace(features);
return constructFromPartialGuildRecordBinding(object2);
}
function fromStoreListingGuild({id, name, icon}) { // fn#16566, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:5609, offset: 0x00e5342a, size: 60 bytes, params: 2, frame: 13
return constructFromPartialGuildRecord({id: id, name: name, icon: icon ?? null});
}
function fromDirectoryGuild({id, name, icon, description, splash, features}) { // fn#16567, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:5762, offset: 0x00e53466, size: 148 bytes, params: 2, frame: 16
const constructFromPartialGuildRecordBinding = constructFromPartialGuildRecord;
const object2 = {};
object2.id = id;
object2.name = name;
object2.icon = icon ?? null;
object2.description = description ?? null;
object2.splash = splash ?? null;
object2.features = (require(1421) /* metro dependency 1421: SetUtils */).toSetInplace(features);
return constructFromPartialGuildRecordBinding(object2);
}
function fromGuildDirectoryEntry({guildId, name, icon, description, splash, features}) { // fn#16568, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:6039, offset: 0x00e534fa, size: 162 bytes, params: 2, frame: 16
const constructFromPartialGuildRecordBinding = constructFromPartialGuildRecord;
const object2 = {};
object2.id = guildId;
object2.name = name ?? '';
object2.icon = icon ?? null;
object2.description = description ?? null;
object2.splash = splash ?? null;
object2.features = (require(1421) /* metro dependency 1421: SetUtils */).toSetInplace(features);
return constructFromPartialGuildRecordBinding(object2);
}
function fromVerificationGateGuild({id, name, icon, description, splash, features, verification_level}) { // fn#16569, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:6345, offset: 0x00e5359c, size: 173 bytes, params: 2, frame: 17
const constructFromPartialGuildRecordBinding = constructFromPartialGuildRecord;
const object2 = {};
object2.id = id;
object2.name = name;
object2.icon = icon ?? null;
object2.description = description ?? null;
object2.splash = splash ?? null;
object2.features = (require(1421) /* metro dependency 1421: SetUtils */).toSetInplace(features);
object2.verificationLevel = verification_level ?? GUILD_DEFAULT_PROPERTY_VALUES.verificationLevel;
return constructFromPartialGuildRecordBinding(object2);
}
function fromClientDiscoverableGuild({id, name, description, splash, banner, preferredLocale, icon, features, premiumSubscriptionCount, discoverySplash}) { // fn#16570, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:6706, offset: 0x00e53649, size: 244 bytes, params: 2, frame: 17
const constructFromPartialGuildRecordBinding = constructFromPartialGuildRecord;
const object2 = {};
object2.id = id;
object2.name = name;
object2.description = description ?? null;
object2.splash = splash ?? null;
object2.banner = banner ?? null;
preferredLocale = preferredLocale ?? GUILD_DEFAULT_PROPERTY_VALUES.preferredLocale;
object2.preferredLocale = preferredLocale;
object2.icon = icon ?? null;
object2.features = (require(1421) /* metro dependency 1421: SetUtils */).toSetInplace(features);
object2.premiumSubscriberCount = premiumSubscriptionCount ?? GUILD_DEFAULT_PROPERTY_VALUES.premiumSubscriberCount;
object2.discoverySplash = discoverySplash ?? null;
return constructFromPartialGuildRecordBinding(object2);
}
function fromGuildBasic({id, name, icon, description, splash, discovery_splash, features}) { // fn#16571, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:7226, offset: 0x00e5373d, size: 171 bytes, params: 2, frame: 16
const constructFromPartialGuildRecordBinding = constructFromPartialGuildRecord;
const object2 = {};
object2.id = id;
object2.name = name;
object2.icon = icon ?? null;
object2.description = description ?? null;
object2.splash = splash ?? null;
object2.discoverySplash = discovery_splash ?? null;
object2.features = (require(1421) /* metro dependency 1421: SetUtils */).toSetInplace(features);
return constructFromPartialGuildRecordBinding(object2);
}
function dangerouslyConstructGuildRecordFromUntypedObject(a0) { // fn#16572, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:7578, offset: 0x00e537e8, size: 998 bytes, params: 2, frame: 19
var r3;
var date;
var value17;
const constructGuildInPlaceBinding = constructGuildInPlace;
const object2 = {};
object2.id = a0.id;
let name = a0.name;
name = !name ? '' : name;
object2.name = name;
let description = a0.description;
description = !description ? null : description;
object2.description = description;
let ownerId = a0.ownerId;
ownerId = !ownerId ? null : ownerId;
object2.ownerId = ownerId;
let icon = a0.icon;
icon = !icon ? null : icon;
object2.icon = icon;
let splash = a0.splash;
splash = !splash ? null : splash;
object2.splash = splash;
let banner = a0.banner;
banner = !banner ? null : banner;
object2.banner = banner;
let homeHeader = a0.homeHeader;
homeHeader = !homeHeader ? null : homeHeader;
object2.homeHeader = homeHeader;
const setUtilsModule = require(1421) /* metro dependency 1421: SetUtils */;
object2.features = setUtilsModule.toSetInplace(a0.features);
let preferredLocale = a0.preferredLocale;
preferredLocale = !preferredLocale ? GUILD_DEFAULT_PROPERTY_VALUES.preferredLocale : preferredLocale;
object2.preferredLocale = preferredLocale;
let afkChannelId = a0.afkChannelId;
afkChannelId = !afkChannelId ? null : afkChannelId;
object2.afkChannelId = afkChannelId;
object2.afkTimeout = a0.afkTimeout;
let systemChannelId = a0.systemChannelId;
systemChannelId = !systemChannelId ? null : systemChannelId;
object2.systemChannelId = systemChannelId;
let verificationLevel = a0.verificationLevel;
verificationLevel = !verificationLevel ? GUILD_DEFAULT_PROPERTY_VALUES.verificationLevel : verificationLevel;
object2.verificationLevel = verificationLevel;
let joinedAt = a0.joinedAt;
let Date = global.Date;
const value11 = joinedAt instanceof Date;
joinedAt = a0.joinedAt;
if (value11) {
r3 = joinedAt;
} else if (joinedAt != null) {
date = new global.Date(a0.joinedAt);
} else {
r3 = a0.joinedAt;
}
object2.joinedAt = r3;
let defaultMessageNotifications = a0.defaultMessageNotifications;
defaultMessageNotifications = !defaultMessageNotifications ? GUILD_DEFAULT_PROPERTY_VALUES.defaultMessageNotifications : defaultMessageNotifications;
object2.defaultMessageNotifications = defaultMessageNotifications;
let mfaLevel = a0.mfaLevel;
mfaLevel = !mfaLevel ? GUILD_DEFAULT_PROPERTY_VALUES.mfaLevel : mfaLevel;
object2.mfaLevel = mfaLevel;
let application_id = a0.application_id;
application_id = !application_id ? null : application_id;
object2.application_id = application_id;
let explicitContentFilter = a0.explicitContentFilter;
explicitContentFilter = !explicitContentFilter ? GUILD_DEFAULT_PROPERTY_VALUES.explicitContentFilter : explicitContentFilter;
object2.explicitContentFilter = explicitContentFilter;
let vanityURLCode = a0.vanityURLCode;
vanityURLCode = !vanityURLCode ? null : vanityURLCode;
object2.vanityURLCode = vanityURLCode;
let premiumTier = a0.premiumTier;
premiumTier = !premiumTier ? GUILD_DEFAULT_PROPERTY_VALUES.premiumTier : premiumTier;
object2.premiumTier = premiumTier;
let premiumSubscriberCount = a0.premiumSubscriberCount;
premiumSubscriberCount = !premiumSubscriberCount ? GUILD_DEFAULT_PROPERTY_VALUES.premiumSubscriberCount : premiumSubscriberCount;
object2.premiumSubscriberCount = premiumSubscriberCount;
let premiumProgressBarEnabled = a0.premiumProgressBarEnabled;
premiumProgressBarEnabled = !premiumProgressBarEnabled ? GUILD_DEFAULT_PROPERTY_VALUES.premiumProgressBarEnabled : premiumProgressBarEnabled;
object2.premiumProgressBarEnabled = premiumProgressBarEnabled;
let premiumProgressBarEnabledUserUpdatedAt = a0.premiumProgressBarEnabledUserUpdatedAt;
Date = global.Date;
const value16 = premiumProgressBarEnabledUserUpdatedAt instanceof Date;
premiumProgressBarEnabledUserUpdatedAt = a0.premiumProgressBarEnabledUserUpdatedAt;
if (value16) {
r3 = premiumProgressBarEnabledUserUpdatedAt;
} else {
value17 = null;
if (value17 != premiumProgressBarEnabledUserUpdatedAt) {
date = new global.Date(a0.premiumProgressBarEnabledUserUpdatedAt);
} else {
r3 = value17;
}
}
object2.premiumProgressBarEnabledUserUpdatedAt = r3;
object2.systemChannelFlags = a0.systemChannelFlags;
let discoverySplash = a0.discoverySplash;
discoverySplash = !discoverySplash ? null : discoverySplash;
object2.discoverySplash = discoverySplash;
let rulesChannelId = a0.rulesChannelId;
rulesChannelId = !rulesChannelId ? null : rulesChannelId;
object2.rulesChannelId = rulesChannelId;
let safetyAlertsChannelId = a0.safetyAlertsChannelId;
safetyAlertsChannelId = !safetyAlertsChannelId ? null : safetyAlertsChannelId;
object2.safetyAlertsChannelId = safetyAlertsChannelId;
let publicUpdatesChannelId = a0.publicUpdatesChannelId;
publicUpdatesChannelId = !publicUpdatesChannelId ? null : publicUpdatesChannelId;
object2.publicUpdatesChannelId = publicUpdatesChannelId;
let maxStageVideoChannelUsers = a0.maxStageVideoChannelUsers;
maxStageVideoChannelUsers = !maxStageVideoChannelUsers ? GUILD_DEFAULT_PROPERTY_VALUES.maxStageVideoChannelUsers : maxStageVideoChannelUsers;
object2.maxStageVideoChannelUsers = maxStageVideoChannelUsers;
let maxVideoChannelUsers = a0.maxVideoChannelUsers;
maxVideoChannelUsers = !maxVideoChannelUsers ? GUILD_DEFAULT_PROPERTY_VALUES.maxVideoChannelUsers : maxVideoChannelUsers;
object2.maxVideoChannelUsers = maxVideoChannelUsers;
let maxMembers = a0.maxMembers;
maxMembers = !maxMembers ? GUILD_DEFAULT_PROPERTY_VALUES.maxMembers : maxMembers;
object2.maxMembers = maxMembers;
let nsfwLevel = a0.nsfwLevel;
const value24 = null;
nsfwLevel = value24 == nsfwLevel ? GUILD_DEFAULT_PROPERTY_VALUES.nsfwLevel : nsfwLevel;
object2.nsfwLevel = nsfwLevel;
const ownerConfiguredContentLevel = a0.ownerConfiguredContentLevel;
object2.ownerConfiguredContentLevel = value24 != ownerConfiguredContentLevel ? ownerConfiguredContentLevel : value24;
object2.hubType = a0.hubType;
const latestOnboardingQuestionId = a0.latestOnboardingQuestionId;
object2.latestOnboardingQuestionId = value24 != latestOnboardingQuestionId ? latestOnboardingQuestionId : value24;
const profile = a0.profile;
object2.profile = value24 != profile ? profile : value24;
const guildTheme = a0.guildTheme;
object2.guildTheme = value24 != guildTheme ? guildTheme : value24;
const premiumFeatures = a0.premiumFeatures;
object2.premiumFeatures = value24 != premiumFeatures ? premiumFeatures : value24;
const moderatorReporting = a0.moderatorReporting;
object2.moderatorReporting = value24 != moderatorReporting ? moderatorReporting : value24;
const gameApplicationIds = a0.gameApplicationIds;
object2.gameApplicationIds = value24 != gameApplicationIds ? gameApplicationIds : value24;
const officialMessageColor = a0.officialMessageColor;
object2.officialMessageColor = value24 != officialMessageColor ? officialMessageColor : value24;
const verificationRoleId = a0.verificationRoleId;
object2.verificationRoleId = value24 != verificationRoleId ? verificationRoleId : value24;
return constructGuildInPlaceBinding(object2);
}
function toGuildProperties(a0) { // fn#16573, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:9924, offset: 0x00e53bce, size: 751 bytes, params: 2, frame: 19
var object2;
var moduleValue;
const object4 = {};
object4.id = a0.id;
object4.name = a0.name;
object4.description = a0.description;
object4.icon = a0.icon;
object4.splash = a0.splash;
object4.banner = a0.banner;
object4.home_header = a0.homeHeader;
const Array = global.Array;
object4.features = Array.from(a0.features);
object4.preferred_locale = a0.preferredLocale;
object4.owner_id = a0.ownerId;
object4.application_id = a0.application_id;
object4.afk_channel_id = a0.afkChannelId;
object4.afk_timeout = a0.afkTimeout;
object4.system_channel_id = a0.systemChannelId;
object4.verification_level = a0.verificationLevel;
object4.explicit_content_filter = a0.explicitContentFilter;
object4.default_message_notifications = a0.defaultMessageNotifications;
object4.mfa_level = a0.mfaLevel;
const vanityURLCode = a0.vanityURLCode;
const value = null;
let r3 = value != vanityURLCode ? vanityURLCode : value;
object4.vanity_url_code = r3;
object4.premium_tier = a0.premiumTier;
object4.premium_progress_bar_enabled = a0.premiumProgressBarEnabled;
const premiumProgressBarEnabledUserUpdatedAt = a0.premiumProgressBarEnabledUserUpdatedAt;
const r4 = value == premiumProgressBarEnabledUserUpdatedAt ? undefined : premiumProgressBarEnabledUserUpdatedAt.toISOString();
object4.premium_progress_bar_enabled_user_updated_at = value != r4 ? r4 : value;
object4.premium_features = value != a0.premiumFeatures ? {features: a0.premiumFeatures.features,
additional_emoji_slots: a0.premiumFeatures.additionalEmojiSlots,
additional_sticker_slots: a0.premiumFeatures.additionalStickerSlots,
additional_sound_slots: a0.premiumFeatures.additionalSoundSlots} : value;
object4.system_channel_flags = a0.systemChannelFlags;
object4.discovery_splash = a0.discoverySplash;
object4.rules_channel_id = a0.rulesChannelId;
object4.safety_alerts_channel_id = a0.safetyAlertsChannelId;
object4.public_updates_channel_id = a0.publicUpdatesChannelId;
object4.max_stage_video_channel_users = a0.maxStageVideoChannelUsers;
object4.max_video_channel_users = a0.maxVideoChannelUsers;
object4.max_members = a0.maxMembers;
object4.nsfw_level = a0.nsfwLevel;
const AGE_RESTRICTED = GuildNSFWContentLevel.AGE_RESTRICTED;
const items2 = [AGE_RESTRICTED];
const EXPLICIT = GuildNSFWContentLevel.EXPLICIT;
items2[1] = EXPLICIT;
object4.nsfw = items2.includes(a0.nsfwLevel);
object4.owner_configured_content_level = a0.ownerConfiguredContentLevel;
object4.hub_type = a0.hubType;
object4.latest_onboarding_question_id = a0.latestOnboardingQuestionId;
object4.profile = a0.profile;
let guildTheme = a0.guildTheme;
if (value != guildTheme) {
guildTheme = a0.guildTheme;
object2 = {};
object2.enabled = guildTheme.enabled;
moduleValue = require(dependencyMap[5]);
copyDataProperties(object2, moduleValue.toServerGuildThemeSettings(guildTheme.themeSettings), dependencyMap);
r3 = object2;
} else {
r3 = value;
}
object4.theme = r3;
object4.moderator_reporting = value != a0.moderatorReporting ? {moderator_reporting_enabled: a0.moderatorReporting.moderatorReportingEnabled,
moderator_report_channel_id: a0.moderatorReporting.moderatorReportChannelId} : value;
object4.official_message_color = a0.officialMessageColor;
object4.incidents_data = value;
object4.game_application_ids = a0.gameApplicationIds;
object4.verification_role_id = a0.verificationRoleId;
return object4;
}
function fromSerializedGuildRecord(a0) { // fn#16574, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:12040, offset: 0x00e53ebd, size: 205 bytes, params: 2, frame: 18
var r6;
var r4;
var date;
const object2 = {};
copyDataProperties(object2, a0, undefined);
const setUtilsModule = require(1421) /* metro dependency 1421: SetUtils */;
object2['features'] = setUtilsModule.toSetInplace(a0.features);
const joinedAt = a0.joinedAt;
const value3 = null;
if (value3 != joinedAt) {
date = new global.Date(a0.joinedAt);
} else {
r6 = value3;
}
object2['joinedAt'] = r6;
if (value3 != a0.premiumProgressBarEnabledUserUpdatedAt) {
date = new global.Date(a0.premiumProgressBarEnabledUserUpdatedAt);
} else {
r4 = value3;
}
object2['premiumProgressBarEnabledUserUpdatedAt'] = r4;
delete object2.roles;
delete object2.member;
return constructGuildInPlace(object2);
}
+327
View File
@@ -0,0 +1,327 @@
/* Metro module 1942; source: utils/GuildRoleRecordUtils.tsx; dependencies: [1419, 1939, 483, 673, 1941, 2] */
function _fun21569(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#21569, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2069:6, offset: 0x00ef3e63, size: 269 bytes, params: 8, frame: 22
const env0_0 = require;
const _arrayLikeToArray_21572 = 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(a0, a1) {
var r2;
var value4;
var id;
var value5;
var object = {};
var value2 = _createForOfIteratorHelperLoose_21570(a1);
var value3 = value2();
if (!value3.done) {
for (r2 = value3; true; r2 = value5) {
value4 = r2.value;
id = value4.id;
object[id] = fromServer_21574(a0, value4);
value5 = value2();
if (value5.done) {
break;
}
}
}
return object;
};
const closure2 = fromServer_21574;
const closure3 = function(a0) {
return constructInPlace(GuildRoleRecordTypeTag, a0);
};
const closure4 = fromSerialized;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const plainRecordModule = require(1419) /* metro dependency 1419: PlainRecord */;
const env0_3 = plainRecordModule.constructInPlace;
const env0_4 = plainRecordModule.objectIsPlainRecordOfType;
const env0_5 = (require(1939) /* metro dependency 1939: GuildRoleRecord */).GuildRoleRecordTypeTag;
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/GuildRoleRecordUtils.tsx');
exports.isGuildRoleRecord = function(a0) {
return objectIsPlainRecordOfType(GuildRoleRecordTypeTag, a0);
};
exports.fromServerArray = closure;
exports.fromServer = closure2;
exports.constructGuildRoleInPlace = closure3;
exports.fromSerialized = closure4;
exports.fromSyncOperation = fromSyncOperation;
exports.fromSerializedPartition = function(a0, a1) {
var propertyName;
var object = {};
for (propertyName in a1) {
object[propertyName] = fromSerialized(a0, a1[propertyName]);
}
return object;
};
exports.toSerializedPartition = function(a0) {
var r11;
var propertyName;
var property;
var object2;
var object = {};
for (propertyName in a0) {
property = a0[propertyName];
object2 = {};
copyDataProperties(object2, property, r11);
property = property.permissions;
object2['permissions'] = property.toString();
object[propertyName] = object2;
r11 = property;
}
return object;
};
}
function _createForOfIteratorHelperLoose_21570(a0, a1) { // fn#21570, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2069:196, offset: 0x00ef3f70, 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 _fun21571;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_21572(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_21572(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_21572(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun21571;
}
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 fromServer_21574(a0, a1) { // fn#21574, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2069:1251, offset: 0x00ef412d, size: 371 bytes, params: 3, frame: 19
var r6;
var moduleValue2;
var value;
const constructGuildRoleInPlaceBinding = constructGuildRoleInPlace;
const object2 = {};
object2.id = a1.id;
object2.name = a1.name;
object2.guildId = a0;
const bigFlagUtilsModule = importAll(483) /* metro dependency 483: BigFlagUtils */;
object2.permissions = bigFlagUtilsModule.deserialize(a1.permissions);
object2.mentionable = a1.mentionable;
object2.position = a1.position;
let color = a1.color;
object2.color = color;
color = a1.color;
const value2 = null;
const value3 = 0;
if (value3 === color) {
r6 = value2;
} else {
moduleValue2 = require(673) /* metro dependency 673: ColorUtils */;
r6 = moduleValue2.int2hex(a1.color);
}
object2.colorString = r6;
const colors = a1.colors;
object2.colors = value2 != colors ? colors : value2;
if (value2 != a1.colors) {
value = require(1941) /* metro dependency 1941: EnhancedRoleColorUtils */;
value = value.extractColorStringsFromServerColors(a1.colors);
r6 = value;
} else {
r6 = value2;
}
object2.colorStrings = r6;
object2.hoist = a1.hoist;
const managed = a1.managed;
object2.managed = value2 != managed && managed;
const tags = a1.tags;
object2.tags = value2 != tags ? tags : {};
object2.icon = a1.icon;
object2.unicodeEmoji = a1.unicode_emoji;
const flags = a1.flags;
object2.flags = value2 != flags ? flags : value3;
const description = a1.description;
object2.description = value2 != description ? description : value2;
object2.version = a1.version;
return constructGuildRoleInPlaceBinding(object2);
}
function fromSerialized(a0, a1) { // fn#21576, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2069:1894, offset: 0x00ef42b8, size: 385 bytes, params: 3, frame: 18
var r5;
var moduleValue2;
var value;
const constructGuildRoleInPlaceBinding = constructGuildRoleInPlace;
const object2 = {};
object2.id = a1.id;
object2.name = a1.name;
object2.guildId = a0;
const bigFlagUtilsModule = importAll(483) /* metro dependency 483: BigFlagUtils */;
object2.permissions = bigFlagUtilsModule.deserialize(a1.permissions);
object2.mentionable = a1.mentionable;
object2.position = a1.position;
let color = a1.color;
object2.color = color;
color = a1.color;
const value2 = null;
if (value2 != color) {
if (a1.color === 0) {
r5 = value2;
} else {
moduleValue2 = require(673) /* metro dependency 673: ColorUtils */;
r5 = moduleValue2.int2hex(a1.color);
}
} else {
r5 = value2;
}
object2.colorString = r5;
const colors = a1.colors;
object2.colors = value2 != colors ? colors : value2;
if (value2 != a1.colors) {
value = require(1941) /* metro dependency 1941: EnhancedRoleColorUtils */;
value = value.extractColorStringsFromServerColors(a1.colors);
r5 = value;
} else {
r5 = value2;
}
object2.colorStrings = r5;
object2.hoist = a1.hoist;
const managed = a1.managed;
object2.managed = value2 != managed && managed;
const tags = a1.tags;
object2.tags = value2 != tags ? tags : {};
object2.icon = a1.icon;
object2.unicodeEmoji = a1.unicodeEmoji;
const flags = a1.flags;
object2.flags = value2 != flags ? flags : 0;
const description = a1.description;
object2.description = value2 != description ? description : value2;
object2.version = a1.version;
return constructGuildRoleInPlaceBinding(object2);
}
function fromSyncOperation(a0, a1, a2) { // fn#21578, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2069:2803, offset: 0x00ef4451, size: 183 bytes, params: 4, frame: 19
var r4;
var value4;
var value5;
var value8;
var id;
var value9;
if (a1.op === 'full_sync') {
return fromServerArray(a0, a1.items);
}
const object2 = {};
copyDataProperties(object2, a2, undefined);
const value2 = _createForOfIteratorHelperLoose_21570(a1.deletes);
const value3 = value2();
let done = value3.done;
if (!done) {
r4 = value3;
reducibleLoop2: while (true) {
value4 = r4.value;
delete object2[value4];
value5 = value2();
done = value5.done;
if (done) {
break reducibleLoop2;
}
r4 = value5;
continue reducibleLoop2;
}
}
const value6 = _createForOfIteratorHelperLoose_21570(a1.writes);
const value7 = value6();
done = value7.done;
if (!done) {
r4 = value7;
reducibleLoop4: while (true) {
value8 = r4.value;
id = value8.id;
object2[id] = fromServer_21574(a0, value8);
value9 = value6();
done = value9.done;
if (done) {
break reducibleLoop4;
}
r4 = value9;
continue reducibleLoop4;
}
}
return object2;
}
+287
View File
@@ -0,0 +1,287 @@
/* Metro module 1940; source: utils/GuildRoleUtils.tsx; dependencies: [21, 673, 1941, 1942, 2] */
function _fun21555(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#21555, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2067:6, offset: 0x00ef377c, size: 185 bytes, params: 8, frame: 19
const env0_0 = require;
const _arrayLikeToArray_21558 = 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 = compareGuildRoles;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/GuildRoleUtils.tsx');
exports.sortGuildRoleRecords = function(a0) {
a0.sort(compareGuildRoles);
return a0;
};
exports.compareGuildRoles = closure;
exports.doesRoleSortHigher = doesRoleSortHigher;
exports.sortInviteRoles = sortInviteRoles;
exports.inviteRoleToDisplayData = inviteRoleToDisplayData;
exports.filterRoleDeletes = filterRoleDeletes;
}
function _createForOfIteratorHelperLoose_21556(a0, a1) { // fn#21556, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2067:46, offset: 0x00ef3835, 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 _fun21557;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_21558(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_21558(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_21558(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun21557;
}
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 compareGuildRoles(a0, a1) { // fn#21559, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2067:956, offset: 0x00ef39a7, size: 179 bytes, params: 3, frame: 17
var r1;
var r0;
var value;
const guildId = a0.guildId;
let id = a0.id;
if (id === guildId) {
id = a1.id;
value = 1;
if (id !== guildId) {
r1 = value;
} else {
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
value = value.compare(a0.id, a1.id);
r1 = value;
}
r0 = r1;
} else {
id = a1.id;
value = -1;
if (id === guildId) {
r0 = value;
} else {
if (a0.position !== a1.position) {
r1 = a1.position - a0.position;
} else {
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
value = value.compare(a0.id, a1.id);
r1 = value;
}
r0 = r1;
}
}
return r0;
}
function doesRoleSortHigher(a0, a1) { // fn#21561, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2067:1406, offset: 0x00ef3a71, size: 29 bytes, params: 3, frame: 13
return compareGuildRoles(a0, a1) < 0;
}
function sortInviteRoles(a0, a1) { // fn#21562, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2067:1491, offset: 0x00ef3a8e, size: 84 bytes, params: 3, frame: 15
var r0;
var value;
if (a0.position !== a1.position) {
r0 = a1.position - a0.position;
} else {
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
value = value.compare(a0.id, a1.id);
r0 = value;
}
return r0;
}
function inviteRoleToDisplayData(a0, a1) { // fn#21563, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2067:1629, offset: 0x00ef3ae2, size: 197 bytes, params: 3, frame: 15
var r3;
var moduleValue;
var moduleValue2;
const object2 = {};
object2.id = a1.id;
object2.name = a1.name;
object2.guildId = a0;
const color = a1.color;
const value = null;
if (color === 0) {
r3 = value;
} else {
moduleValue = require(673) /* metro dependency 673: ColorUtils */;
r3 = moduleValue.int2hex(a1.color);
}
object2.colorString = r3;
if (value != a1.colors) {
moduleValue2 = require(1941) /* metro dependency 1941: EnhancedRoleColorUtils */;
r3 = moduleValue2.extractColorStringsFromServerColors(a1.colors);
} else {
r3 = value;
}
object2.colorStrings = r3;
const icon = a1.icon;
object2.icon = value != icon ? icon : value;
const unicode_emoji = a1.unicode_emoji;
object2.unicodeEmoji = value != unicode_emoji ? unicode_emoji : value;
return object2;
}
function filterRoleDeletes(a0, a1) { // fn#21564, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2067:1953, offset: 0x00ef3ba7, size: 208 bytes, params: 3, frame: 21
var r3;
var r4;
var value3;
var done;
var value4;
var value5;
var value8;
var id;
var moduleValue;
var fromServer;
var value9;
let value = a2;
const value2 = a3;
reducibleJoin2: while (true) {
if (value !== undefined) {
r3 = value;
break reducibleJoin2;
}
r3 = [];
break reducibleJoin2;
}
reducibleJoin4: while (true) {
if (value2 !== undefined) {
r4 = value2;
break reducibleJoin4;
}
r4 = [];
break reducibleJoin4;
}
if (r4.length + r3.length === 0) {
return a1;
}
const object2 = {};
copyDataProperties(object2, a1, undefined);
reducibleJoin8: while (true) {
if (r4 == null) {
break reducibleJoin8;
}
value = environment;
value = _createForOfIteratorHelperLoose_21556(r4);
value3 = value();
done = value3.done;
if (done) {
break reducibleJoin8;
}
r4 = value3;
reducibleLoop7: while (true) {
value4 = r4.value;
delete object2[value4];
value5 = value();
done = value5.done;
if (done) {
break reducibleJoin8;
}
r4 = value5;
continue reducibleLoop7;
}
}
const value6 = _createForOfIteratorHelperLoose_21556(r3);
const value7 = value6();
done = value7.done;
if (!done) {
r3 = value7;
reducibleLoop9: while (true) {
value8 = r3.value;
id = value8.id;
moduleValue = importAll(1942) /* metro dependency 1942: GuildRoleRecordUtils */;
fromServer = moduleValue.fromServer;
object2[id] = Reflect.apply(fromServer, moduleValue, [a0, value8]);
value9 = value6();
done = value9.done;
if (done) {
break reducibleLoop9;
}
r3 = value9;
continue reducibleLoop9;
}
}
return object2;
}
+140
View File
@@ -0,0 +1,140 @@
/* Metro module 6592; source: utils/GuildUtils.tsx; dependencies: [1867, 1878, 1393, 672, 6593, 3995, 1244, 2] */
function _fun51866(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#51866, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6770:6, offset: 0x012e6708, size: 254 bytes, params: 8, frame: 21
var object2;
const env0_0 = require;
const closure = getGuildNameSuggestion;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
let value = importDefault(1393) /* metro dependency 1393 */;
const Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
const MINUTE = Millis.MINUTE;
value = new value({maxAge: 1 * MINUTE});
object2 = {getGuildNameSuggestion: closure, requestMembers: requestMembers};
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/GuildUtils.tsx');
exports.default = object2;
exports.getGuildNameSuggestion = closure;
}
function requestMembersDebounced(a0, a1, a2) { // fn#51867, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6770:167, offset: 0x012e6806, size: 85 bytes, params: 4, frame: 14
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
if (env0_4 != null) {
global.clearTimeout(env0_4);
}
env0_4 = global.setTimeout(_fun51868, 200);
}
function getCachedResults(a0, a1) { // fn#51871, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6770:534, offset: 0x012e698d, size: 93 bytes, params: 3, frame: 16
let value = a0;
const value2 = '';
value = value2 + (value ?? value2) + ':' + a1;
const value4 = env0_7.get(value);
if (value4 != null) {
return value4;
}
env0_7.set(value, true);
}
function getGuildNameSuggestion(a0) { // fn#51872, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6770:637, offset: 0x012e69ea, size: 182 bytes, params: 2, frame: 20
var r0;
var intl;
const name = (importAll(3995) /* metro dependency 3995: UserUtils */).getName(UserStore.getCurrentUser());
const value4 = '';
if (name == null) {
r0 = value4;
} else if (name.length === 0) {
r0 = value4;
} else {
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r0 = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.Y6Qfju,
{username: a0 == null ? name : a0.truncateUsername ? name.slice(0, 20) : name});
}
return r0;
}
function requestMembers(a0, a1) { // fn#51873, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6770:909, offset: 0x012e6aa0, size: 151 bytes, params: 3, frame: 19
var r1;
let value = a2;
const env0_0 = a1;
const r3 = value !== undefined ? value : 10;
const Array = global.Array;
value = Array.isArray(a0);
const items2 = [];
if (value) {
a0.forEach(_fun51874);
r1 = false;
} else {
r1 = getCachedResults(a0, a1) == null && true;
}
if (items2.length > 0) {
if (value) {
requestMembersDebounced(items2, a1, r3);
} else if (r1) {
requestMembersDebounced(a0, a1, r3);
}
} else if (r1) {
requestMembersDebounced(a0, a1, r3);
}
}
function _fun51868() { // fn#51868, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6770:246, offset: 0x012e685b, size: 232 bytes, params: 1, frame: 18
var environment;
var Array;
var value2;
var guild;
var push;
var value4;
var guildIds;
var items2;
var value6;
var defaultImport;
const closure = pushGuild;
const items3 = [];
const env0_0 = items3;
if (env0_0 == null) {
push = items3.push;
value4 = environment.__proto__;
guildIds = GuildStore.getGuildIds();
items2 = [];
arraySpread(items2, guildIds, 0, undefined);
apply(push, items2, items3, undefined);
} else {
Array = global.Array;
if (Array.isArray(env0_0)) {
env0_0.forEach(_fun51870);
} else {
value2 = environment.__proto__;
guild = GuildStore.getGuild(env0_0);
if (guild != null) {
closure(guild);
}
}
}
if (items3.length > 0) {
value6 = environment.__proto__;
defaultImport = importDefault(6593) /* metro dependency 6593: GuildActionCreators */;
defaultImport.requestMembers(items3, require.toLocaleLowerCase(), importDefault);
}
}
function _fun51874(a0) { // fn#51874, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6770:980, offset: 0x012e6b37, size: 47 bytes, params: 2, frame: 14
if (getCachedResults(a0, require) == null) {
env0_1.push(a0);
}
}
function pushGuild({id}) { // fn#51869, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6770:260, offset: 0x012e6943, size: 29 bytes, params: 2, frame: 11
env0_0.push(id);
}
function _fun51870(a0) { // fn#51870, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6770:369, offset: 0x012e6960, size: 45 bytes, params: 2, frame: 11
let value = environment.__proto__.__proto__;
value = GuildStore.getGuild(a0);
if (value != null) {
pushGuild(value);
}
}
+79
View File
@@ -0,0 +1,79 @@
/* Metro module 1948; source: utils/HelpdeskUtils.tsx; dependencies: [1949, 661, 3768, 477, 2] */
function _fun21706(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#21706, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2075:6, offset: 0x00ef7c36, size: 319 bytes, params: 8, frame: 20
var object2;
const env0_0 = require;
const getLocale = function() {
return LocaleStore.locale.toLowerCase();
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const localeStore = importDefault(1949) /* metro dependency 1949: LocaleStore */;
let value = require(661) /* metro dependency 661: Constants */;
const env0_4 = value.LocalizedLinks;
const SUPPORT_DOMAIN = value.SUPPORT_DOMAIN;
const SUPPORT_DEV_DOMAIN = value.SUPPORT_DEV_DOMAIN;
value = 'https://' + SUPPORT_DOMAIN;
const env0_6 = 'https://' + SUPPORT_DEV_DOMAIN;
object2 = {getArticleURL: getArticleURL, getDevArticleURL: getDevArticleURL,
getCreatorSupportArticleURL: getCreatorSupportArticleURL, getTwitterURL: function() {
return importDefault(dependencyMap[2])(LocalizedLinks.TWITTER);
}, getCommunityURL: getCommunityURL, getSubmitRequestURL: getSubmitRequestURL, getSearchURL: function(a0) {
return wrapURL('/hc/' + getLocale() + '/search?utf8=%E2%9C%93&query=' + (0,
global.encodeURIComponent)(a0) + '&commit=Search');
}, getFeaturedArticlesJsonURL: function() {
return wrapURL('/api/v2/help_center/en-us/articles.json?label_names=featured');
}, getAppsSupportURL: getAppsSupportURL};
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/HelpdeskUtils.tsx');
exports.default = object2;
exports.SUPPORT_LOCATION = value;
}
function wrapURL(a0) { // fn#21707, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2075:211, offset: 0x00ef7d75, size: 25 bytes, params: 2, frame: 2
const value = a1;
return (value !== undefined ? value : env0_5) + a0;
}
function getArticleURL(a0) { // fn#21709, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2075:318, offset: 0x00ef7da7, size: 59 bytes, params: 2, frame: 17
return wrapURL('/hc/' + getLocale() + '/articles/' + a0);
}
function getDevArticleURL(a0) { // fn#21710, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2075:382, offset: 0x00ef7de2, size: 64 bytes, params: 2, frame: 18
return wrapURL('/hc/' + getLocale() + '/articles/' + a0, env0_6);
}
function getCreatorSupportArticleURL(a0) { // fn#21711, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2075:459, offset: 0x00ef7e22, size: 66 bytes, params: 2, frame: 17
const wrapURLBinding = wrapURL;
let value = getLocale();
value = '/hc/' + value + '/articles/' + a0;
return wrapURLBinding(value, 'https://creator-support.discord.com');
}
function getCommunityURL() { // fn#21713, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2075:597, offset: 0x00ef7e8e, size: 48 bytes, params: 1, frame: 13
return wrapURL('/hc/' + getLocale());
}
function getSubmitRequestURL(a0) { // fn#21714, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2075:631, offset: 0x00ef7ebe, size: 146 bytes, params: 2, frame: 19
var r0;
var value;
const wrapURLBinding = wrapURL;
const locale = getLocale();
const encodeURIComponent = global.encodeURIComponent;
const getPlatformName = (require(477) /* metro dependency 477: PlatformUtils */).getPlatformName;
value = encodeURIComponent(Reflect.apply(getPlatformName, value, []));
value = wrapURLBinding('/hc/' + locale + '/requests/new?platform=' + value);
if (a0 == null) {
r0 = value;
} else {
value += '&device_info=' + global.encodeURIComponent(a0);
r0 = value;
}
return r0;
}
function getAppsSupportURL(a0) { // fn#21717, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2075:1075, offset: 0x00ef7faf, size: 66 bytes, params: 2, frame: 17
const wrapURLBinding = wrapURL;
let value = getLocale();
value = '/hc/' + value + '/articles/' + a0;
return wrapURLBinding(value, 'https://support-apps.discord.com');
}
+255
View File
@@ -0,0 +1,255 @@
/* Metro module 4600; source: utils/HighlightJsAnsiLanguage.tsx; dependencies: [2] */
function _fun39041(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#39041, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4778:6, offset: 0x010d65a3, size: 254 bytes, params: 8, frame: 18
var RegExp;
const _arrayLikeToArray_39044 = 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 Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = {1: 'bold', 4: 'underline'};
const env0_1 = {30: 'black', 31: 'red', 32: 'green', 33: 'yellow', 34: 'blue', 35: 'magenta', 36: 'cyan',
37: 'white'};
const env0_2 = {40: 'black', 41: 'red', 42: 'green', 43: 'yellow', 44: 'blue', 45: 'magenta', 46: 'cyan',
47: 'white'};
const regexp = RegExp('\\x1B\\[(\\d+(?:[:;]\\d+)*)m', '');
RegExp = global.RegExp;
const regExp = new RegExp('(?=' + regexp.source + ')');
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/HighlightJsAnsiLanguage.tsx');
exports.default = highlightJsAnsiLanguage;
exports.ANSI_CONTROL_SEQUENCE_RE = regexp;
}
function _createForOfIteratorHelperLoose_39042(a0, a1) { // fn#39042, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4778:47, offset: 0x010d66a1, 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 _fun39043;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_39044(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_39044(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_39044(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun39043;
}
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 makeAnsiRuleCategory(a0, a1, a2, a3) { // fn#39045, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4778:1281, offset: 0x010d6813, size: 130 bytes, params: 5, frame: 17
var push;
var value;
var items2;
const env0_0 = a0;
const items3 = ['0'];
arraySpread(items3, a2, 1, undefined);
if (a3) {
push = items3.push;
value = global.Object.keys(a1);
items2 = [];
arraySpread(items2, value, 0, undefined);
apply(push, items2, items3, undefined);
}
const Object = global.Object;
return Object.entries(a1).map(_fun39046);
}
function highlightJsAnsiLanguage() { // fn#39049, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4778:1824, offset: 0x010d6a09, size: 251 bytes, params: 1, frame: 22
var r2;
var property;
var value6;
const makeAnsiRuleCategoryBinding = makeAnsiRuleCategory;
const ansiRuleCategory = makeAnsiRuleCategoryBinding('foreground', env0_1, ['38', '39'], true);
let items2 = [];
const value2 = 0;
const value5 = arraySpread(items2, makeAnsiRuleCategoryBinding('style', env0_0, [], false), arraySpread(items2,
makeAnsiRuleCategoryBinding('background', env0_2, ['48', '49'], true), arraySpread(items2, ansiRuleCategory,
value2, true), true), false);
items2[value5] = {className: 'ansi-control-sequence', begin: env0_3, starts: {end: env0_4, endsParent: true}};
value5 + 1;
let length = items2.length;
if (value2 < length) {
for (r2 = value2; true; r2 = value6) {
property = items2[r2];
property.contains = items2.slice(r2 + 1);
value6 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
length = items2.length;
if (!(value6 < length)) {
break;
}
}
}
items2 = [{begin: env0_4, contains: items2}];
return {contains: items2};
}
function _fun39046(a0) { // fn#39046, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4778:1396, offset: 0x010d6895, size: 95 bytes, params: 2, frame: 19
var r0;
var r1;
var r3;
var item3;
var value3;
const iterator = a0[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
const value = undefined;
const value2 = item2 === value;
const r4 = value2 ? value : item;
if (value2) {
r0 = item2;
r1 = value2;
r3 = value;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r0 = item3;
r1 = value3;
r3 = value;
} else {
r0 = item3;
r1 = value3;
r3 = item;
}
}
if (!r1) {
r0.return();
}
return makeAnsiRule(env0_0, r3, r4, env0_1);
}
function makeAnsiRule(a0, a1, a2, a3) { // fn#39047, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4778:1405, offset: 0x010d68f4, size: 92 bytes, params: 5, frame: 17
const env0_0 = a2;
const env0_1 = a3;
return {className: 'ansi-' + a0 + '-' + a1, endsParent: true, begin: env2_4, ['on:begin']: _fun39048};
}
function _fun39048([, property], a1) { // fn#39048, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4778:1503, offset: 0x010d6950, size: 185 bytes, params: 3, frame: 18
var r3;
var value5;
var includes;
var value6;
let value = property.split(';');
let data = a1.data;
if (data.isOn === undefined) {
data = a1.data;
data.isOn = false;
}
value = _createForOfIteratorHelperLoose_39042(value);
const value3 = value();
let done = value3.done;
if (!done) {
r3 = value3;
while (true) {
value5 = r3.value;
if (value5 !== importDefault) {
includes = importAll.includes;
if (Reflect.apply(includes, importAll, [value5])) {
a1.data.isOn = false;
break;
}
break;
}
data = a1.data;
data.isOn = true;
value6 = value();
done = value6.done;
if (done) {
break;
}
r3 = value6;
continue;
}
}
if (!a1.data.isOn) {
a1.ignoreMatch();
}
}
+445
View File
@@ -0,0 +1,445 @@
/* Metro module 1475; source: utils/ImageUtils.tsx; dependencies: [5, 1476, 1477, 22, 44, 2] */
function _fun16856(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#16856, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1602:6, offset: 0x00e5d237, size: 384 bytes, params: 8, frame: 22
let env0_0 = require;
const closure = fit;
const closure2 = getPalette;
const closure3 = dataUrlToBlob;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
object = [[0, 0, 0]];
(importDefault(22) /* metro dependency 22 */).memoize(function(a0) {
var env0_0 = a0;
var Promise = global.Promise;
var value = Object.create(Promise.prototype, {constructor: {value: Promise}});
var value2 = new Promise(_fun16867);
return value2 instanceof Object ? value2 : value;
});
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/ImageUtils.tsx');
exports.fit = closure;
exports.IMAGE_MAX_ZOOM = 2000;
exports.zoomFit = zoomFit;
exports.zoomScale = zoomScale;
exports.getRatio = function({width, height, maxWidth, maxHeight}) {
var r4;
var value = 1;
r4 = width > maxWidth ? maxWidth / width : value;
var Math = global.Math;
Math.round(width * r4);
var value3 = global.Math.round(height * r4);
return global.Math.min(r4 * (value3 > maxHeight ? maxHeight / value3 : value), value);
};
exports.getCoverRatio = function({width, height, maxWidth, maxHeight}) {
if (width === height) {
return 1;
}
var Math = global.Math;
var value = maxWidth / width;
value = Math.max(value, maxHeight / height);
return global.Math.min(value, 1);
};
exports.hasDimensions = function({width, height}) {
return width != null && width !== 0 && height != null && height !== 0;
};
exports.makeCssUrlString = function(a0) {
return a0 == null || a0 === '' ? 'none' : 'url(' + a0 + ')';
};
exports.getPalette = closure2;
exports.getPaletteForAvatar = function(a0) {
return require(dependencyMap[2]).default.getPaletteForAvatarMobile(a0);
};
exports.readFileAsBase64 = function(a0) {
var env0_0 = a0;
var Promise = global.Promise;
var value = Object.create(Promise.prototype, {constructor: {value: Promise}});
var value2 = new Promise(_fun16878);
return value2 instanceof Object ? value2 : value;
};
exports.dataUriFileSize = function(a0) {
var value = a0.split(';base64,');
importDefault(dependencyMap[4])(value.length === 2, 'Input data is not a valid image.');
return global.atob(value[1]).length;
};
exports.dataUrlToFile = function() {
return _dataUrlToFile.apply(this, arguments);
};
exports.dataUrlToBlob = closure3;
exports.isPNGAnimated = function() {
return _isPNGAnimated.apply(this, arguments);
};
exports.preloadImage = function(a0) {
var env0_0 = a0;
var Promise = global.Promise;
var value = Object.create(Promise.prototype, {constructor: {value: Promise}});
var value2 = new Promise(_fun16885);
return value2 instanceof Object ? value2 : value;
};
}
function fit({width, height, maxWidth, maxHeight, minWidth, minHeight}) { // fn#16857, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1602:113, offset: 0x00e5d3b7, size: 258 bytes, params: 2, frame: 23
var r0;
var r9;
var r1;
var r2;
var value;
var Math;
var max;
var Math2;
var round;
var value3;
var Math3;
var value4;
var Math4;
var Math5;
minWidth = minWidth === undefined ? 0 : minWidth;
minHeight = minHeight === undefined ? 0 : minHeight;
if (width !== maxWidth) {
value = 1;
r0 = width > maxWidth ? maxWidth / width : value;
Math = global.Math;
max = Math.max;
Math2 = global.Math;
round = Math2.round;
value3 = Reflect.apply(max, Math, [Reflect.apply(round, Math2, [width * r0]), minWidth]);
Math = global.Math;
max = Math.max;
Math3 = global.Math;
round = Math3.round;
value4 = Reflect.apply(max, Math, [Reflect.apply(round, Math3, [height * r0]), minHeight]);
r9 = value4 > maxHeight ? maxHeight / value4 : value;
Math = global.Math;
max = Math.max;
Math4 = global.Math;
round = Math4.round;
value = Reflect.apply(max, Math, [Reflect.apply(round, Math4, [value3 * r9]), minWidth]);
Math = global.Math;
max = Math.max;
Math5 = global.Math;
round = Math5.round;
r1 = Reflect.apply(max, Math, [Reflect.apply(round, Math5, [value4 * r9]), minHeight]);
r2 = value;
} else if (height === maxHeight) {
r1 = height;
r2 = width;
} else {
value = 1;
r0 = width > maxWidth ? maxWidth / width : value;
Math = global.Math;
max = Math.max;
Math2 = global.Math;
round = Math2.round;
value3 = Reflect.apply(max, Math, [Reflect.apply(round, Math2, [width * r0]), minWidth]);
Math = global.Math;
max = Math.max;
Math3 = global.Math;
round = Math3.round;
value4 = Reflect.apply(max, Math, [Reflect.apply(round, Math3, [height * r0]), minHeight]);
r9 = value4 > maxHeight ? maxHeight / value4 : value;
Math = global.Math;
max = Math.max;
Math4 = global.Math;
round = Math4.round;
value = Reflect.apply(max, Math, [Reflect.apply(round, Math4, [value3 * r9]), minWidth]);
Math = global.Math;
max = Math.max;
Math5 = global.Math;
round = Math5.round;
r1 = Reflect.apply(max, Math, [Reflect.apply(round, Math5, [value4 * r9]), minHeight]);
r2 = value;
}
return {width: r2, height: r1};
}
function getPalette(a0, a1, a2) { // fn#16858, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1602:426, offset: 0x00e5d4b9, size: 361 bytes, params: 4, frame: 31
var r13;
var value5;
var property;
var property2;
var property3;
var property4;
var value6;
var value7;
var value8;
var value9;
var value10;
var value11;
let value = global.document.createElement('canvas');
const context = value.getContext('2d');
if (context == null) {
value = environment;
return env0_4;
}
const width = a0.width;
const value3 = 128;
const value4 = 0;
let r0 = value4 === width ? value3 : a0.width;
value.width = r0;
let height = a0.height;
height = value4 === height ? value3 : a0.height;
value.height = height;
context.drawImage(a0, value4, value4, r0, height);
const getImageData = context.getImageData;
const data = Reflect.apply(getImageData, context, [value4, value4, r0, height]).data;
value = r0 * height;
const items2 = [];
if (value4 < value) {
r0 = value4;
while (true) {
value5 = 4 * r0;
property = data[value4 + value5];
property2 = data[value5 + 1];
property3 = data[value5 + 2];
property4 = data[value5 + 3];
value6 = property4 === undefined;
if (value6) {
r13 = value6;
} else {
value7 = property4 >= 125;
r13 = value7;
}
if (!r13) {
continue;
}
value8 = property > 250;
if (!value8) {
r13 = value8;
continue;
}
value9 = property2 > 250;
r13 = value9;
if (!r13) {
continue;
}
value10 = property3 > 250;
r13 = value10;
if (r13) {
continue;
}
items2.push([property, property2, property3]);
value11 = r0 + a2;
if (value11 < value) {
r0 = value11;
continue;
}
break;
}
}
const value12 = (importDefault(1476) /* metro dependency 1476 */)(items2, a1);
return typeof value12 === 'boolean' ? env0_4 : value12.palette();
}
function _dataUrlToFile() { // fn#16859, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1602:1127, offset: 0x00e5d622, size: 48 bytes, params: 1, frame: 14
return env0_3(_fun16861).apply(this, arguments);
}
function dataUrlToBlob(a0) { // fn#16862, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1602:1300, offset: 0x00e5d6c6, size: 283 bytes, params: 2, frame: 16
var r4;
var r5;
var btoa;
var atob;
var charCodeAt;
var value3;
let value = a0.split(',');
const value2 = 0;
let property = value[value2];
if (property.indexOf('base64') >= value2) {
atob = global.atob;
value = a0.split(',');
value = atob(value[1]);
r4 = value;
} else {
btoa = global.btoa;
value = a0.split(',');
value = btoa(value[1]);
r4 = value;
}
property = Reflect.apply(a0.split(',')[value2].split(':')[1].split, property, [';'])[value2];
const Uint8Array = global.Uint8Array;
let length = r4.length;
let uint8Array = new Uint8Array(length);
length = r4.length;
if (value2 < length) {
for (r5 = value2; true; r5 = value3) {
charCodeAt = r4.charCodeAt;
uint8Array[r5] = Reflect.apply(charCodeAt, r4, [r5]);
value3 = typeof r5 === 'bigint' ? r5 + 1n : +r5 + 1;
length = r4.length;
if (!(value3 < length)) {
break;
}
}
}
const Blob = global.Blob;
const items2 = [uint8Array];
const object2 = {type: property};
uint8Array = Object.create(Blob.prototype, {constructor: {value: Blob}});
const blob = new Blob(items2, object2);
return blob instanceof Object ? blob : uint8Array;
}
function _isPNGAnimated() { // fn#16863, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1602:1566, offset: 0x00e5d7e1, size: 48 bytes, params: 1, frame: 14
return env0_3(_fun16865).apply(this, arguments);
}
function _fun16866(a0) { // fn#16866, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1602:929, offset: 0x00e5d8d4, size: 44 bytes, params: 2, frame: 11
const env0_0 = a0;
const Promise = global.Promise;
const value = Object.create(Promise.prototype, {constructor: {value: Promise}});
const promise = new Promise(_fun16867);
return promise instanceof Object ? promise : value;
}
function zoomFit(a0, a1) { // fn#16870, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1602:1946, offset: 0x00e5d9d2, size: 258 bytes, params: 3, frame: 17
let Math = global.Math;
let min = Math.min;
const Math2 = global.Math;
let value = Math2.round(0.65 * global.window.innerHeight);
const Math3 = global.Math;
value = Reflect.apply(min, Math, [value, Math3.round(global.window.innerHeight)]);
Math = global.Math;
min = Math.min;
const Math4 = global.Math;
const value2 = Math4.round(0.75 * global.window.innerWidth);
const Math5 = global.Math;
const value3 = Reflect.apply(min, Math, [value2, Math5.round(global.window.innerWidth)]);
Math = global.Math;
value = Math.min(value, 2000);
const fitBinding = fit;
const object2 = {width: a0, height: a1};
Math = global.Math;
object2.maxWidth = Math.min(value3, 2000);
object2.maxHeight = value;
return fitBinding(object2);
}
function zoomScale(a0, a1, a2, a3) { // fn#16871, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1602:2222, offset: 0x00e5dad4, size: 270 bytes, params: 5, frame: 21
let Math = global.Math;
const max = Math.max;
let value = 0;
let r4 = a0 != null ? value === a0 ? value : a1 != null ? value === a1 ? value : a0 / a2 : value : value;
value = 2;
const value2 = Reflect.apply(max, Math, [value, r4]);
const r5 = a2 != null && a2 * value2 > global.window.innerWidth * 1.6 ? global.window.innerWidth * 1.6 / a2 : value;
r4 = a3 != null && a3 * value2 > global.window.innerHeight * 1.6 ? global.window.innerHeight * 1.6 / a3 : value;
Math = global.Math;
const value11 = Math.min(value2, r5, r4);
const parseFloat = global.parseFloat;
value = value11.toFixed(value);
return parseFloat(value);
}
function readFileAsBase64(a0) { // fn#16877, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1602:3166, offset: 0x00e5dd49, size: 44 bytes, params: 2, frame: 11
const env0_0 = a0;
const Promise = global.Promise;
const value = Object.create(Promise.prototype, {constructor: {value: Promise}});
const promise = new Promise(_fun16878);
return promise instanceof Object ? promise : value;
}
function preloadImage(a0) { // fn#16884, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1602:3752, offset: 0x00e5deba, size: 44 bytes, params: 2, frame: 11
const env0_0 = a0;
const Promise = global.Promise;
const value = Object.create(Promise.prototype, {constructor: {value: Promise}});
const promise = new Promise(_fun16885);
return promise instanceof Object ? promise : value;
}
function* _fun16861(a0, a1, a2) { // fn#16861, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1602:1178, offset: 0x00e5d65b, size: 107 bytes, params: 4, frame: 17
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
value = env2_8(a0);
yield value.arrayBuffer();
value = undefined;
if (false) {
return value;
}
const File = global.File;
const items2 = [value];
value = Object.create(File.prototype, {constructor: {value: File}});
const file = new File(items2, a1, {type: a2});
return file instanceof Object ? file : value;
}
function* _fun16865(a0) { // fn#16865, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1602:1617, offset: 0x00e5d81a, size: 186 bytes, params: 2, frame: 15
var r2;
if (false) {
return undefined;
}
const type = a0.type;
if ((type == null ? undefined : type.split(';')[0]) !== 'image/png') {
throw new global.Error('File is not a PNG');
}
yield a0.text();
value = undefined;
if (false) {
return value;
}
const value4 = value.indexOf('IDAT');
const value5 = value4 > 0;
if (value5) {
value = value.substring(0, value4);
value = value.indexOf('acTL');
value = value !== -1;
r2 = value;
} else {
r2 = value5;
}
return r2;
}
function _fun16867(a0, a1) { // fn#16867, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1602:945, offset: 0x00e5d900, size: 107 bytes, params: 3, frame: 10
const env0_0 = a0;
const env0_1 = a1;
const Image = global.Image;
const image = new Image();
image.crossOrigin = 'Anonymous';
image.onerror = onerror_16868;
image.onload = onload;
image.src = env0_0;
}
function _fun16878(a0, a1) { // fn#16878, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1602:3215, offset: 0x00e5dd75, size: 92 bytes, params: 3, frame: 12
const env0_0 = a0;
const env0_1 = a1;
const FileReader = global.FileReader;
const fileReader = new FileReader();
fileReader.readAsDataURL(env0_0);
fileReader.onload = onload_16879;
fileReader.onerror = function(a0) {
return require(a0);
};
}
function _fun16885(a0, a1) { // fn#16885, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1602:3797, offset: 0x00e5dee6, size: 83 bytes, params: 3, frame: 13
const Image = global.Image;
const image = new Image();
image.addEventListener('load', a0);
image.addEventListener('error', a1);
image.src = env0_0;
}
function onerror_16868(a0) { // fn#16868, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1602:1005, offset: 0x00e5d96b, size: 41 bytes, params: 2, frame: 13
require(a0);
const binding = env0_2;
binding.onload = null;
binding.onerror = null;
}
function onload() { // fn#16869, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1602:1055, offset: 0x00e5d994, size: 62 bytes, params: 1, frame: 17
let binding = env0_0;
binding(getPalette(env0_2, 5, 10));
binding = env0_2;
binding.onload = null;
binding.onerror = null;
}
function onload_16879() { // fn#16879, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1602:3272, offset: 0x00e5ddd1, size: 78 bytes, params: 1, frame: 15
let value = environment.__proto__.__proto__;
value = importDefault(44) /* metro dependency 44 */;
const binding = env0_2;
value(typeof binding.result === 'string', 'Result must be a string');
env0_0(binding.result);
}
File diff suppressed because it is too large. Load diff
+90
View File
@@ -0,0 +1,90 @@
/* Metro module 10545; source: utils/InviteErrorUtils.tsx; dependencies: [1878, 661, 3802, 1244, 1948, 2] */
function _fun81318(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#81318, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10731:6, offset: 0x01eca1d8, size: 183 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_4 = constantsModule.AbortCodes;
const env0_5 = constantsModule.HelpdeskArticles;
const env0_6 = constantsModule.MAX_USER_GUILDS;
const env0_7 = constantsModule.MAX_USER_GUILDS_PREMIUM;
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/InviteErrorUtils.tsx');
exports.getDescriptiveInviteError = getDescriptiveInviteError;
exports.getInviteError = getInviteError;
}
function getDescriptiveInviteError(a0) { // fn#81319, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10731:288, offset: 0x01eca28f, size: 618 bytes, params: 2, frame: 19
var object2;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var currentUser;
var value3;
var defaultImport;
const TOO_MANY_USER_GUILDS = AbortCodes.TOO_MANY_USER_GUILDS;
if (TOO_MANY_USER_GUILDS === a0) {
currentUser = UserStore.getCurrentUser();
value3 = undefined;
defaultImport = importDefault(3802) /* metro dependency 3802: PremiumUtils */;
return {title: intl.formatToPlainString(t['ttJ/hj'],
{quantity: defaultImport.canUseIncreasedGuildCap(currentUser) || (currentUser == null ? value3 : currentUser.isStaff()) ? MAX_USER_GUILDS_PREMIUM : MAX_USER_GUILDS}),
description: intl.string(t.iLyuDO)};
}
const GUILD_AT_CAPACITY = AbortCodes.GUILD_AT_CAPACITY;
if (GUILD_AT_CAPACITY === a0) {
object2 = {};
object2.title = intl.string(t.ZZlox4);
object2.description = intl.string(t.ZUEGFn);
return object2;
}
const GUILD_JOIN_INVITE_LIMITED_ACCESS = AbortCodes.GUILD_JOIN_INVITE_LIMITED_ACCESS;
if (GUILD_JOIN_INVITE_LIMITED_ACCESS === a0) {
object2 = {};
object2.title = intl.string(t.kJwpBW);
object2.description = intl.string(t.ZUEGFn);
return object2;
}
const USER_GUILD_JOIN_LARGE_GUILD_UNDERAGE_DISALLOWED = AbortCodes.USER_GUILD_JOIN_LARGE_GUILD_UNDERAGE_DISALLOWED;
if (USER_GUILD_JOIN_LARGE_GUILD_UNDERAGE_DISALLOWED === a0) {
object2 = {};
object2.title = intl.string(t['u/xsK9']);
object2.description = intl.string(t.SxY4IW);
return object2;
}
return null;
}
function getInviteError(a0) { // fn#81320, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10731:1059, offset: 0x01eca4f9, size: 495 bytes, params: 2, frame: 18
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var format;
var RXSeLl;
var defaultImport;
const TOO_MANY_USER_GUILDS = AbortCodes.TOO_MANY_USER_GUILDS;
if (TOO_MANY_USER_GUILDS === a0) {
return intl.string(t.iLyuDO);
}
const GUILD_AT_CAPACITY = AbortCodes.GUILD_AT_CAPACITY;
if (GUILD_AT_CAPACITY === a0) {
return intl.string(t.M6unNJ);
}
const INVALID_COUNTRY_CODE = AbortCodes.INVALID_COUNTRY_CODE;
if (INVALID_COUNTRY_CODE === a0) {
return intl.string(t.sRJGR1);
}
const INVALID_CANNOT_FRIEND_SELF = AbortCodes.INVALID_CANNOT_FRIEND_SELF;
if (INVALID_CANNOT_FRIEND_SELF === a0) {
return intl.string(t['mY2R+F']);
}
const INVITES_DISABLED = AbortCodes.INVITES_DISABLED;
if (INVITES_DISABLED === a0) {
format = intl.format;
RXSeLl = t.RXSeLl;
defaultImport = importDefault(1948) /* metro dependency 1948: HelpdeskUtils */;
return Reflect.apply(format, intl, [RXSeLl,
{articleLink: defaultImport.getArticleURL(HelpdeskArticles.INVITE_DISABLED)}]);
}
return intl.string(t.dDZRdy);
}
+201
View File
@@ -0,0 +1,201 @@
/* Metro module 9047; source: utils/LazyAPIPromise.tsx; dependencies: [5, 57, 31, 4131, 2] */
function _fun70686(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#70686, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9232:6, offset: 0x01d034a3, size: 149 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(5) /* metro dependency 5 */;
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/LazyAPIPromise.tsx');
exports.default = useLazyAPIPromise;
}
function useLazyAPIPromise(a0, a1) { // fn#70687, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9232:197, offset: 0x01d03538, size: 140 bytes, params: 3, frame: 19
const env0_0 = a0;
const env0_1 = a1;
const binding = env0_4;
let useState = binding.useState;
const value2 = Reflect.apply(useState, binding, [false]);
const binding2 = env0_3;
let value = binding2(value2, 2);
const property = value[0];
const env0_2 = value[1];
useState = binding.useState;
value = binding2(Reflect.apply(useState, binding, [null]), 2);
const property2 = value[0];
var env0_3 = value[1];
return [function() {
return _execFn.apply(this, arguments);
}, {loading: property, error: property2}];
}
function _execFn() { // fn#70688, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9232:315, owner: useLazyAPIPromise._execFn, offset: 0x01d035c4, size: 53 bytes, params: 1, frame: 13
var environment;
const value = environment.__proto__;
return env1_2(_fun70690).apply(this, arguments);
}
function* _fun70690() { // fn#70690, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9232:352, offset: 0x01d03604, size: 183 bytes, params: 1, frame: 17
var moduleValue;
var value3;
var value4;
var binding;
var error;
var value5;
var APIError;
var prototype;
var value6;
var aPIError;
var value7;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
env2_2(true);
env2_3(null);
try {
} catch (error) {
value5 = environment.__proto__.__proto__.__proto__;
binding = env3_0;
APIError = binding(env3_1[3]).APIError;
prototype = APIError.prototype;
value6 = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value7 = aPIError instanceof Object ? aPIError : value6;
if (dependencyMap == null) {
env2_3(value7);
env2_2(false);
return null;
}
dependencyMap(value7);
env2_3(value7);
env2_2(false);
return null;
}
try {
moduleValue = require();
} catch (error) {
value5 = environment.__proto__.__proto__.__proto__;
binding = env3_0;
APIError = binding(env3_1[3]).APIError;
prototype = APIError.prototype;
value6 = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value7 = aPIError instanceof Object ? aPIError : value6;
if (dependencyMap == null) {
env2_3(value7);
env2_2(false);
return null;
}
dependencyMap(value7);
env2_3(value7);
env2_2(false);
return null;
}
yield moduleValue;
try {
value3 = undefined;
value4 = false;
} catch (error) {
value5 = environment.__proto__.__proto__.__proto__;
binding = env3_0;
APIError = binding(env3_1[3]).APIError;
prototype = APIError.prototype;
value6 = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value7 = aPIError instanceof Object ? aPIError : value6;
if (dependencyMap == null) {
env2_3(value7);
env2_2(false);
return null;
}
dependencyMap(value7);
env2_3(value7);
env2_2(false);
return null;
}
if (!value4) {
try {
binding = env2_2;
} catch (error) {
value5 = environment.__proto__.__proto__.__proto__;
binding = env3_0;
APIError = binding(env3_1[3]).APIError;
prototype = APIError.prototype;
value6 = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value7 = aPIError instanceof Object ? aPIError : value6;
if (dependencyMap == null) {
env2_3(value7);
env2_2(false);
return null;
}
dependencyMap(value7);
env2_3(value7);
env2_2(false);
return null;
}
try {
binding(false);
} catch (error) {
value5 = environment.__proto__.__proto__.__proto__;
binding = env3_0;
APIError = binding(env3_1[3]).APIError;
prototype = APIError.prototype;
value6 = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value7 = aPIError instanceof Object ? aPIError : value6;
if (dependencyMap == null) {
env2_3(value7);
env2_2(false);
return null;
}
dependencyMap(value7);
env2_3(value7);
env2_2(false);
return null;
}
try {
binding = env2_3;
} catch (error) {
value5 = environment.__proto__.__proto__.__proto__;
binding = env3_0;
APIError = binding(env3_1[3]).APIError;
prototype = APIError.prototype;
value6 = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value7 = aPIError instanceof Object ? aPIError : value6;
if (dependencyMap == null) {
env2_3(value7);
env2_2(false);
return null;
}
dependencyMap(value7);
env2_3(value7);
env2_2(false);
return null;
}
try {
binding(null);
} catch (error) {
value5 = environment.__proto__.__proto__.__proto__;
binding = env3_0;
APIError = binding(env3_1[3]).APIError;
prototype = APIError.prototype;
value6 = Object.create(prototype, {constructor: {value: APIError}});
aPIError = new APIError();
value7 = aPIError instanceof Object ? aPIError : value6;
if (dependencyMap == null) {
env2_3(value7);
env2_2(false);
return null;
}
dependencyMap(value7);
env2_3(value7);
env2_2(false);
return null;
}
}
return value3;
}
+102
View File
@@ -0,0 +1,102 @@
/* Metro module 4278; source: utils/LibraryApplicationUtils.tsx; dependencies: [57, 1878, 4279, 661, 3829, 2] */
function _fun36264(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#36264, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4450:6, offset: 0x01087244, size: 277 bytes, params: 8, frame: 20
const env0_0 = require;
const closure = function(a0) {
var value = a0;
var value2 = null;
return value2 == value ? value2 : value.type === LocalDispatchApplicationStates.INSTALLING || value.type === LocalDispatchApplicationStates.UPDATING ? value : value.type !== LocalDispatchApplicationStates.UNINSTALLING ? value2 : value;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(57) /* metro dependency 57 */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const skuStore = importDefault(4279) /* metro dependency 4279: SKUStore */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_5 = constantsModule.LibraryApplicationFlags;
const env0_6 = constantsModule.LocalDispatchApplicationStates;
const env0_7 = constantsModule.StatusTypes;
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/LibraryApplicationUtils.tsx');
exports.getComboId = function(a0, a1) {
return '' + a0 + ':' + a1;
};
exports.convertComboId = convertComboId;
exports.shouldShareApplicationActivity = shouldShareApplicationActivity;
exports.calculateProgressPercentage = function(a0, a1) {
var value = 100;
return a1 === 0 ? value : a0 / a1 * value;
};
exports.shouldShowGameInLibrary = shouldShowGameInLibrary;
exports.convertToTransitionState = closure;
exports.getCombinedProgress = function(a0) {
return a0.reduce(_fun36272, {'total': 0, 'progress': 0});
};
exports.isUserEntitledToLibraryApplication = isUserEntitledToLibraryApplication;
}
function convertComboId(a0) { // fn#36267, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4450:488, offset: 0x010873ad, size: 61 bytes, params: 2, frame: 13
let value = a0.split(':');
value = env0_2(value, 2);
return {applicationId: value[0], branchId: value[1]};
}
function shouldShareApplicationActivity(a0, a1) { // fn#36268, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4450:618, offset: 0x010873ea, size: 147 bytes, params: 3, frame: 14
var activeLibraryApplication;
const ShowCurrentGame = (require(3829) /* metro dependency 3829: UserSettings */).ShowCurrentGame;
const getSetting = ShowCurrentGame.getSetting;
if (Reflect.apply(getSetting, ShowCurrentGame, [])) {
if ((require(3829) /* metro dependency 3829: UserSettings */).StatusSetting.getSetting() === StatusTypes.INVISIBLE) {
return false;
}
activeLibraryApplication = a1.getActiveLibraryApplication(a0);
return activeLibraryApplication == null || !activeLibraryApplication.hasFlag(LibraryApplicationFlags.PRIVATE);
}
return false;
}
function shouldShowGameInLibrary(a0, a1, a2) { // fn#36270, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4450:965, offset: 0x01087499, size: 74 bytes, params: 4, frame: 13
var r1;
var r0;
var enabled;
const value = a1 != null;
if (value) {
enabled = a2.enabled;
r1 = enabled ? !a1.hasFlag(LibraryApplicationFlags.PRIVATE) : !enabled;
r1 = r1 && !a1.isHidden();
r0 = r1;
} else {
r0 = value;
}
return r0;
}
function getCombinedProgress(a0) { // fn#36271, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4450:1149, offset: 0x010874e3, size: 38 bytes, params: 2, frame: 13
return a0.reduce(function(a0, a1) {
var r0;
var property;
var object;
var value = a0;
var value3 = convertToTransitionState(a1);
if (value3 == null) {
r0 = value;
} else {
property = a1.type;
if (property === LocalDispatchApplicationStates.UP_TO_DATE) {
r0 = value;
} else {
object = {};
property = value.total;
object.total = property + global.Number(value3.total);
property = value.progress;
object.progress = property + global.Number(value3.progress);
r0 = object;
}
}
return r0;
}, {'total': 0, 'progress': 0});
}
function isUserEntitledToLibraryApplication(a0) { // fn#36273, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4450:1413, offset: 0x01087585, size: 58 bytes, params: 2, frame: 15
const isDiscordApplication = a0.isDiscordApplication();
return isDiscordApplication ? a0.isEntitled(UserStore.getCurrentUser(), SKUStore) : !!isDiscordApplication;
}
+19
View File
@@ -0,0 +1,19 @@
/* Metro module 8866; source: utils/ListUtils.tsx; dependencies: [1244, 2] */
function _fun69128(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#69128, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9051:6, offset: 0x01c69f6d, size: 96 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/ListUtils.tsx');
exports.getListSummaryLabel = getListSummaryLabel;
}
function getListSummaryLabel(a0, a1) { // fn#69129, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9051:167, offset: 0x01c69fcd, size: 405 bytes, params: 3, frame: 21
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const r10 = a1 ?? a0.length;
return r10 === 0 ? '' : r10 === 1 ? intl.formatToPlainString(t['8s9z8P'],
{first: a0[0]}) : r10 === 2 ? intl.formatToPlainString(t['i0K/dw'], {first: a0[0],
second: a0[1]}) : r10 === 3 ? intl.formatToPlainString(t['/KSOKY'], {first: a0[0], second: a0[1],
third: a0[2]}) : intl.formatToPlainString(t.xpU76u, {first: a0[0], second: a0[1], third: a0[2], count: r10 - 3});
}
+69
View File
@@ -0,0 +1,69 @@
/* Metro module 8980; source: utils/MFAUtils.tsx; dependencies: [27, 1581, 8981, 1216, 2] */
function _fun69993(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#69993, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9165:6, offset: 0x01ceaa90, size: 301 bytes, params: 8, frame: 22
var r4;
var value6;
const closure = function(a0) {
return a0.replace(RegExp('[\\s._-]+', 'g'), '').toUpperCase();
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const window = global.window;
let value = undefined;
const r10 = (window == null ? value : window.crypto) ?? (global.window == null ? value : global.window.msCrypto);
const r5 = r10 != null && 'getRandomValues' in r10 && 'Uint8Array' in global.window;
const NativeModules = (require(27) /* metro dependency 27 */).NativeModules;
const DCDSecurityKeyManager = NativeModules.DCDSecurityKeyManager;
const value5 = DCDSecurityKeyManager != null;
if (value5) {
value6 = require(1581) /* metro dependency 1581: MetaQuestUtilsAndroid */;
r4 = !value6.isMetaQuest();
} else {
r4 = value5;
}
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/MFAUtils.tsx');
exports.hasCrypto = r5;
exports.hasWebAuthn = r4;
exports.generateTotpSecret = generateTotpSecret;
exports.encodeTotpSecret = closure;
exports.encodeTotpSecretAsUrl = function(a0, a1) {
var r3;
var value = a2;
r3 = value !== undefined ? value : 'Discord';
return 'otpauth://totp/' + (0, global.encodeURI)(r3) + ':' + (0,
global.encodeURI)(a0) + '?secret=' + encodeTotpSecret(a1) + '&issuer=' + (0, global.encodeURIComponent)(r3);
};
exports.captureWebAuthnException = captureWebAuthnException;
return value;
}
function generateTotpSecret() { // fn#69995, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9165:508, offset: 0x01ceabe9, size: 180 bytes, params: 1, frame: 15
const binding = env0_2;
const getRandomValues = binding.getRandomValues;
const Uint8Array = global.Uint8Array;
const value2 = Object.create(Uint8Array.prototype, {constructor: {value: Uint8Array}});
const uint8Array = new Uint8Array(20);
const value4 = Reflect.apply(getRandomValues, binding, [uint8Array instanceof Object ? uint8Array : value2]);
let value = importDefault(8981) /* metro dependency 8981 */;
value = value.encode(value4);
value = value.toString('utf8');
value = value.replace(RegExp('=', 'g'), '');
value = value.toLowerCase();
value = value.replace(RegExp('(\\w{4})', 'g'), '$1 ');
return value.trim();
}
function captureWebAuthnException(a0, a1) { // fn#69997, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9165:1012, offset: 0x01cead0b, size: 108 bytes, params: 3, frame: 17
const value = undefined;
const defaultImport = importDefault(1216) /* metro dependency 1216: SentryUtilsNative */;
const captureException = defaultImport.captureException;
const object3 = {};
copyDataProperties(object3, a1, undefined);
const object4 = {};
const value2 = a1 == null;
copyDataProperties(object4, value2 ? value : a1.tags, value2);
object4['app_context'] = 'webauthn';
object3['tags'] = object4;
Reflect.apply(captureException, defaultImport, [a0, object3]);
return value;
}
+717
View File
@@ -0,0 +1,717 @@
/* Metro module 8872; source: utils/MaskedLinkUtils.tsx; dependencies: [8873, 1379, 1867, 8874, 4814, 3793, 1934, 661, 3855, 4647, 1244, 683, 8875, 8876, 8877, 8878, 3847, 10195, 10199, 6626, 10200, 10202, 2] */
function _fun69157(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#69157, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9057:6, offset: 0x01c6b26e, size: 279 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const blockedDomainStore = importDefault(8873) /* metro dependency 8873: BlockedDomainStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
const maskedLinkStore = importDefault(8874) /* metro dependency 8874: MaskedLinkStore */;
const messageStore = importDefault(4814) /* metro dependency 4814: MessageStore */;
const relationshipStore = importDefault(3793) /* metro dependency 3793: RelationshipStore */;
const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_10 = constantsModule.ChannelTypes;
const env0_11 = constantsModule.AnalyticEvents;
const env0_12 = constantsModule.GuildFeatures;
const env0_13 = constantsModule.MessageFlags;
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/MaskedLinkUtils.tsx');
exports.isLinkTrusted = isLinkTrusted;
exports.handleClick = handleClick;
}
function isLinkTrusted(a0, a1) { // fn#69158, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9057:326, offset: 0x01c6b385, size: 122 bytes, params: 3, frame: 14
var isFriend;
var value;
const getChannel = ChannelStore.getChannel;
const getChannelId = SelectedChannelStore.getChannelId;
const value2 = Reflect.apply(getChannel, ChannelStore, [Reflect.apply(getChannelId, SelectedChannelStore, [])]);
let r1 = value2 != null && value2.type === ChannelTypes.DM;
if (r1) {
isFriend = RelationshipStore.isFriend;
value = value2.getRecipientId();
value = !Reflect.apply(isFriend, RelationshipStore, [value ?? '']);
r1 = value;
}
return !r1 && a0 === a1;
}
function handleClick(a0, a1) { // fn#69159, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9057:496, offset: 0x01c6b3ff, size: 2143 bytes, params: 3, frame: 53
var r1;
var guild_id;
var r39;
var r10;
var r11;
var r12;
var r15;
var r102;
var r27;
var r6;
var r13;
var r21;
var r212;
var r213;
var object2;
var decodeURI;
var error;
var encodeURI;
var value5;
var message;
var basicChannel;
var getGuild;
var guild;
var messageReference;
var message_id;
var channel_id;
var channel;
var value20;
var defaultImport2;
var track;
var URL_CLICKED;
var id;
var defaultImport3;
var closure;
const TRUSTED_URLS = (require(10199) /* metro dependency 10199: TrustedURLs */).TRUSTED_URLS;
var protocol;
var value30;
const trustDomain = (require(10202) /* metro dependency 10202: MaskedLinkActionCreators */).trustDomain;
const trustProtocol = (require(10202) /* metro dependency 10202: MaskedLinkActionCreators */).trustProtocol;
var defaultImport7;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
let value = a2;
const value2 = undefined;
const r2 = value !== value2 ? value : [];
var env0_2;
const trusted = a0.trusted;
const onClick = a0.onClick;
const env0_0 = a0.onConfirm;
const onCancel = a0.onCancel;
const shouldConfirm = a0.shouldConfirm;
const messageId = a0.messageId;
const channelId = a0.channelId;
const defaultImport = importDefault(3855) /* metro dependency 3855 */;
const value3 = defaultImport.sanitizeUrl(a0.href);
const value4 = null;
if (value4 == value3) {
if (value4 != a1) {
a1.preventDefault();
}
defaultImport7 = importDefault(4647) /* metro dependency 4647: AlertActionCreators */;
defaultImport7.show({title: intl.string(t.x87gan), body: intl.format(t['9rqRwl'], {url: a0.href}),
isDismissable: true, contextKey: a3});
} else {
try {
decodeURI = global.decodeURI;
decodeURI(value3);
r1 = value3;
} catch (error) {
encodeURI = global.encodeURI;
value5 = encodeURI(value3);
env0_2 = value5;
r1 = value5;
}
var value6 = false;
if (value4 == messageId) {
r6 = value6;
r11 = value4;
r12 = channelId;
r13 = value4;
r15 = messageId;
} else if (value4 == channelId) {
r6 = value6;
r11 = value4;
r12 = channelId;
r13 = value4;
r15 = messageId;
} else {
message = MessageStore.getMessage(channelId, messageId);
basicChannel = ChannelStore.getBasicChannel(channelId);
guild_id = value4 == basicChannel ? value2 : basicChannel.guild_id;
r39 = value4 != guild_id ? guild_id : value4;
guild = GuildStore.getGuild(r39);
if (value4 == message) {
guild_id = value2;
} else {
messageReference = message.messageReference;
guild_id = value4 == messageReference ? value2 : messageReference.guild_id;
}
r10 = value4 != guild_id && value4 != (value4 == message ? value2 : message.webhookId) && (value4 == message ? value2 : message.hasFlag(MessageFlags.IS_CROSSPOST)) && value4 != r39;
if (r10) {
if (value4 == message) {
guild_id = value2;
} else {
messageReference = message.messageReference;
guild_id = value4 == messageReference ? value2 : messageReference.guild_id;
}
if (value4 != guild_id) {
messageReference = message.messageReference;
message_id = messageReference.message_id;
messageReference = message.messageReference;
channel_id = messageReference.channel_id;
messageReference = message.messageReference;
r11 = messageReference.guild_id;
r12 = channel_id;
r15 = message_id;
} else {
r11 = r39;
r12 = channelId;
r15 = messageId;
}
} else {
r11 = r39;
r12 = channelId;
r15 = messageId;
}
r102 = (value4 == basicChannel ? value2 : basicChannel.type) === ChannelTypes.GUILD_ANNOUNCEMENT && (value4 == guild ? value2 : guild.features.has(GuildFeatures.COMMUNITY)) === true;
r27 = value4 == message ? value2 : message.hasFlag(MessageFlags.EPHEMERAL);
r27 = value4 != message && !(r27 === true);
r10 = r27 && (r10 || r102);
r6 = r10;
r13 = r39;
}
if (value4 != channelId) {
channel = ChannelStore.getChannel(channelId);
getGuild = GuildStore.getGuild;
r10 = value4 == channel ? value2 : channel.getGuildId();
value20 = Reflect.apply(getGuild, GuildStore, [r10]);
r10 = value4 != channel && value4 != value20 && value20.features.has(GuildFeatures.DISCOVERABLE);
if (r10) {
defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
track = defaultImport2.track;
URL_CLICKED = AnalyticEvents.URL_CLICKED;
object2 = {};
object2.url_domain = (require(8875) /* metro dependency 8875: MaskedLinkStoreMethodsAdditionalNative */).getHostname(r1);
id = value20.id;
object2.guild_id = id;
id = channel.id;
object2.channel_id = id;
Reflect.apply(track, defaultImport2, [URL_CLICKED, object2]);
}
if ((importDefault(8876) /* metro dependency 8876: isChangelogChannel */)(channelId)) {
defaultImport3 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
defaultImport3.track(AnalyticEvents.CHANGE_LOG_CTA_CLICKED, {cta_type: 'inline_link', target: r1});
}
}
(importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */).trackLinkClicked(r1);
if (value4 != onClick) {
if (onClick(a1)) {
return value2;
}
closure = onConfirm;
r21 = value4 != onCancel ? onCancel : function() {
};
if (value4 !== BlockedDomainStore.isBlockedDomain(r1)) {
if (value4 != a1) {
a1.preventDefault();
}
(importDefault(10195) /* metro dependency 10195: BlockedDomainModalActionCreatorsNative */).show(r1);
return value2;
}
r212 = (typeof trusted === 'function' ? trusted() : trusted) || TRUSTED_URLS.has(r1);
protocol = (require(8875) /* metro dependency 8875: MaskedLinkStoreMethodsAdditionalNative */).getProtocol(r1);
r213 = protocol === 'http:' || protocol === 'https:';
if (r213) {
if (r212) {
if (value4 == a1) {
closure();
} else if (value4 == shouldConfirm) {
if (r6) {
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId,
guildId: r13,
sourceChannelId: r12,
sourceGuildId: r11});
}
} else if (shouldConfirm) {
closure();
} else if (r6) {
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
sourceChannelId: r12,
sourceGuildId: r11});
}
} else if (MaskedLinkStore.isTrustedDomain(r1)) {
if (value4 == a1) {
closure();
} else if (value4 == shouldConfirm) {
if (r6) {
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId,
guildId: r13,
sourceChannelId: r12,
sourceGuildId: r11});
}
} else if (shouldConfirm) {
closure();
} else if (r6) {
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
sourceChannelId: r12,
sourceGuildId: r11});
}
} else if (r213) {
if (value4 != a1) {
a1.preventDefault();
}
if (r213) {
value30 = (require(6626) /* metro dependency 6626: MarkupLinkRule */).punycodeLink(r1);
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: value4 != value30 ? value30.displayTarget : r1,
trustUrl: trustDomain, onConfirm: closure, onCancel: r21, isProtocol: value6,
contextKey: a3});
} else {
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: r1,
trustUrl: trustProtocol, onConfirm: closure, onCancel: r21, isProtocol: true,
contextKey: a3});
}
} else if (MaskedLinkStore.isTrustedProtocol(r1)) {
if (value4 == a1) {
closure();
} else if (value4 == shouldConfirm) {
if (r6) {
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId,
guildId: r13,
sourceChannelId: r12,
sourceGuildId: r11});
}
} else if (shouldConfirm) {
closure();
} else if (r6) {
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
sourceChannelId: r12,
sourceGuildId: r11});
}
} else {
if (value4 != a1) {
a1.preventDefault();
}
if (r213) {
value30 = (require(6626) /* metro dependency 6626: MarkupLinkRule */).punycodeLink(r1);
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: value4 != value30 ? value30.displayTarget : r1,
trustUrl: trustDomain, onConfirm: closure, onCancel: r21, isProtocol: value6,
contextKey: a3});
} else {
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: r1,
trustUrl: trustProtocol, onConfirm: closure, onCancel: r21, isProtocol: true,
contextKey: a3});
}
}
} else if (r213) {
if (value4 != a1) {
a1.preventDefault();
}
if (r213) {
value30 = (require(6626) /* metro dependency 6626: MarkupLinkRule */).punycodeLink(r1);
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: value4 != value30 ? value30.displayTarget : r1,
trustUrl: trustDomain, onConfirm: closure, onCancel: r21, isProtocol: value6, contextKey: a3});
} else {
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: r1,
trustUrl: trustProtocol, onConfirm: closure, onCancel: r21, isProtocol: true, contextKey: a3});
}
} else if (MaskedLinkStore.isTrustedProtocol(r1)) {
if (value4 == a1) {
closure();
} else if (value4 == shouldConfirm) {
if (r6) {
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
sourceChannelId: r12,
sourceGuildId: r11});
}
} else if (shouldConfirm) {
closure();
} else if (r6) {
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
sourceChannelId: r12,
sourceGuildId: r11});
}
} else {
if (value4 != a1) {
a1.preventDefault();
}
if (r213) {
value30 = (require(6626) /* metro dependency 6626: MarkupLinkRule */).punycodeLink(r1);
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: value4 != value30 ? value30.displayTarget : r1,
trustUrl: trustDomain, onConfirm: closure, onCancel: r21, isProtocol: value6, contextKey: a3});
} else {
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: r1,
trustUrl: trustProtocol, onConfirm: closure, onCancel: r21, isProtocol: true, contextKey: a3});
}
}
return value2;
}
var value24 = (require(8878) /* metro dependency 8878: getOnClick */).default(r1, {skipExtensionCheck: value2,
analyticsLocations: r2, messageId: messageId});
if (value4 == value24) {
closure = onConfirm;
r21 = value4 != onCancel ? onCancel : function() {
};
if (value4 !== BlockedDomainStore.isBlockedDomain(r1)) {
if (value4 != a1) {
a1.preventDefault();
}
(importDefault(10195) /* metro dependency 10195: BlockedDomainModalActionCreatorsNative */).show(r1);
return value2;
}
r212 = (typeof trusted === 'function' ? trusted() : trusted) || TRUSTED_URLS.has(r1);
protocol = (require(8875) /* metro dependency 8875: MaskedLinkStoreMethodsAdditionalNative */).getProtocol(r1);
r213 = protocol === 'http:' || protocol === 'https:';
if (r213) {
if (r212) {
if (value4 == a1) {
closure();
} else if (value4 == shouldConfirm) {
if (r6) {
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId,
guildId: r13,
sourceChannelId: r12,
sourceGuildId: r11});
}
} else if (shouldConfirm) {
closure();
} else if (r6) {
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
sourceChannelId: r12,
sourceGuildId: r11});
}
} else if (MaskedLinkStore.isTrustedDomain(r1)) {
if (value4 == a1) {
closure();
} else if (value4 == shouldConfirm) {
if (r6) {
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId,
guildId: r13,
sourceChannelId: r12,
sourceGuildId: r11});
}
} else if (shouldConfirm) {
closure();
} else if (r6) {
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
sourceChannelId: r12,
sourceGuildId: r11});
}
} else if (r213) {
if (value4 != a1) {
a1.preventDefault();
}
if (r213) {
value30 = (require(6626) /* metro dependency 6626: MarkupLinkRule */).punycodeLink(r1);
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: value4 != value30 ? value30.displayTarget : r1,
trustUrl: trustDomain, onConfirm: closure, onCancel: r21, isProtocol: value6,
contextKey: a3});
} else {
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: r1,
trustUrl: trustProtocol, onConfirm: closure, onCancel: r21, isProtocol: true,
contextKey: a3});
}
} else if (MaskedLinkStore.isTrustedProtocol(r1)) {
if (value4 == a1) {
closure();
} else if (value4 == shouldConfirm) {
if (r6) {
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId,
guildId: r13,
sourceChannelId: r12,
sourceGuildId: r11});
}
} else if (shouldConfirm) {
closure();
} else if (r6) {
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
sourceChannelId: r12,
sourceGuildId: r11});
}
} else {
if (value4 != a1) {
a1.preventDefault();
}
if (r213) {
value30 = (require(6626) /* metro dependency 6626: MarkupLinkRule */).punycodeLink(r1);
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: value4 != value30 ? value30.displayTarget : r1,
trustUrl: trustDomain, onConfirm: closure, onCancel: r21, isProtocol: value6,
contextKey: a3});
} else {
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: r1,
trustUrl: trustProtocol, onConfirm: closure, onCancel: r21, isProtocol: true,
contextKey: a3});
}
}
} else if (r213) {
if (value4 != a1) {
a1.preventDefault();
}
if (r213) {
value30 = (require(6626) /* metro dependency 6626: MarkupLinkRule */).punycodeLink(r1);
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: value4 != value30 ? value30.displayTarget : r1,
trustUrl: trustDomain, onConfirm: closure, onCancel: r21, isProtocol: value6, contextKey: a3});
} else {
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: r1,
trustUrl: trustProtocol, onConfirm: closure, onCancel: r21, isProtocol: true, contextKey: a3});
}
} else if (MaskedLinkStore.isTrustedProtocol(r1)) {
if (value4 == a1) {
closure();
} else if (value4 == shouldConfirm) {
if (r6) {
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
sourceChannelId: r12,
sourceGuildId: r11});
}
} else if (shouldConfirm) {
closure();
} else if (r6) {
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
sourceChannelId: r12,
sourceGuildId: r11});
}
} else {
if (value4 != a1) {
a1.preventDefault();
}
if (r213) {
value30 = (require(6626) /* metro dependency 6626: MarkupLinkRule */).punycodeLink(r1);
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: value4 != value30 ? value30.displayTarget : r1,
trustUrl: trustDomain, onConfirm: closure, onCancel: r21, isProtocol: value6, contextKey: a3});
} else {
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: r1,
trustUrl: trustProtocol, onConfirm: closure, onCancel: r21, isProtocol: true, contextKey: a3});
}
}
return value2;
}
if (value24(a1)) {
return value2;
}
closure = onConfirm;
r21 = value4 != onCancel ? onCancel : function() {
};
if (value4 !== BlockedDomainStore.isBlockedDomain(r1)) {
if (value4 != a1) {
a1.preventDefault();
}
(importDefault(10195) /* metro dependency 10195: BlockedDomainModalActionCreatorsNative */).show(r1);
return value2;
}
r212 = (typeof trusted === 'function' ? trusted() : trusted) || TRUSTED_URLS.has(r1);
protocol = (require(8875) /* metro dependency 8875: MaskedLinkStoreMethodsAdditionalNative */).getProtocol(r1);
r213 = protocol === 'http:' || protocol === 'https:';
if (r213) {
if (r212) {
if (value4 == a1) {
closure();
} else if (value4 == shouldConfirm) {
if (r6) {
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
sourceChannelId: r12,
sourceGuildId: r11});
}
} else if (shouldConfirm) {
closure();
} else if (r6) {
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
sourceChannelId: r12,
sourceGuildId: r11});
}
} else if (MaskedLinkStore.isTrustedDomain(r1)) {
if (value4 == a1) {
closure();
} else if (value4 == shouldConfirm) {
if (r6) {
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
sourceChannelId: r12,
sourceGuildId: r11});
}
} else if (shouldConfirm) {
closure();
} else if (r6) {
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
sourceChannelId: r12,
sourceGuildId: r11});
}
} else if (r213) {
if (value4 != a1) {
a1.preventDefault();
}
if (r213) {
value30 = (require(6626) /* metro dependency 6626: MarkupLinkRule */).punycodeLink(r1);
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: value4 != value30 ? value30.displayTarget : r1,
trustUrl: trustDomain, onConfirm: closure, onCancel: r21, isProtocol: value6, contextKey: a3});
} else {
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: r1,
trustUrl: trustProtocol, onConfirm: closure, onCancel: r21, isProtocol: true, contextKey: a3});
}
} else if (MaskedLinkStore.isTrustedProtocol(r1)) {
if (value4 == a1) {
closure();
} else if (value4 == shouldConfirm) {
if (r6) {
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
sourceChannelId: r12,
sourceGuildId: r11});
}
} else if (shouldConfirm) {
closure();
} else if (r6) {
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
sourceChannelId: r12,
sourceGuildId: r11});
}
} else {
if (value4 != a1) {
a1.preventDefault();
}
if (r213) {
value30 = (require(6626) /* metro dependency 6626: MarkupLinkRule */).punycodeLink(r1);
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: value4 != value30 ? value30.displayTarget : r1,
trustUrl: trustDomain, onConfirm: closure, onCancel: r21, isProtocol: value6, contextKey: a3});
} else {
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: r1,
trustUrl: trustProtocol, onConfirm: closure, onCancel: r21, isProtocol: true, contextKey: a3});
}
}
} else if (r213) {
if (value4 != a1) {
a1.preventDefault();
}
if (r213) {
value30 = (require(6626) /* metro dependency 6626: MarkupLinkRule */).punycodeLink(r1);
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: value4 != value30 ? value30.displayTarget : r1,
trustUrl: trustDomain, onConfirm: closure, onCancel: r21, isProtocol: value6, contextKey: a3});
} else {
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: r1,
trustUrl: trustProtocol, onConfirm: closure, onCancel: r21, isProtocol: true, contextKey: a3});
}
} else if (MaskedLinkStore.isTrustedProtocol(r1)) {
if (value4 == a1) {
closure();
} else if (value4 == shouldConfirm) {
if (r6) {
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
sourceChannelId: r12,
sourceGuildId: r11});
}
} else if (shouldConfirm) {
closure();
} else if (r6) {
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
sourceChannelId: r12,
sourceGuildId: r11});
}
} else {
if (value4 != a1) {
a1.preventDefault();
}
if (r213) {
value30 = (require(6626) /* metro dependency 6626: MarkupLinkRule */).punycodeLink(r1);
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: value4 != value30 ? value30.displayTarget : r1,
trustUrl: trustDomain, onConfirm: closure, onCancel: r21, isProtocol: value6, contextKey: a3});
} else {
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: r1,
trustUrl: trustProtocol, onConfirm: closure, onCancel: r21, isProtocol: true, contextKey: a3});
}
}
}
return value2;
}
function handleClickOnConfirm() { // fn#69160, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9057:2085, owner: handleClick.onConfirm, offset: 0x01c6bc5e, size: 150 bytes, params: 1, frame: 13
var value2;
var value3;
if (env0_4) {
value2 = environment.__proto__;
(importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */).trackAnnouncementMessageLinkClicked({messageId: env0_5,
channelId: channelId, guildId: env0_3, sourceChannelId: env0_6, sourceGuildId: guild_id});
}
if (onConfirm == null) {
value3 = environment.__proto__;
(importDefault(3847) /* metro dependency 3847: openURL */)(env0_2);
} else {
onConfirm();
}
}
+34
View File
@@ -0,0 +1,34 @@
/* Metro module 7216; source: utils/MemoizerUtils.tsx; dependencies: [2] */
function _fun57713(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57713, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7394:6, offset: 0x016b42c1, size: 92 bytes, params: 8, frame: 16
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/MemoizerUtils.tsx');
exports.default = {makeMemoizer: function(a0) {
var env0_0 = a0;
var Map = global.Map;
var env0_1 = new Map();
return _fun57715;
}};
}
function makeMemoizer(a0) { // fn#57714, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7394:112, offset: 0x016b431d, size: 48 bytes, params: 2, frame: 10
const env0_0 = a0;
const Map = global.Map;
const map = new Map();
return _fun57715;
}
function _fun57715(a0) { // fn#57715, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7394:158, offset: 0x016b434d, size: 55 bytes, params: 2, frame: 14
var r0;
var value3;
const value2 = env0_1.get(a0);
if (value2 !== undefined) {
r0 = value2;
} else {
value3 = env0_0(a0);
env0_1.set(a0, value3);
r0 = value3;
}
return r0;
}
+223
View File
@@ -0,0 +1,223 @@
/* Metro module 11013; source: utils/MentionGuardUtils.tsx; dependencies: [57, 6875, 3784, 661, 44, 7076, 2] */
function _fun84372(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84372, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11199:6, offset: 0x01f4764f, size: 290 bytes, params: 8, frame: 21
var object2;
const _arrayLikeToArray_84375 = 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 = everyoneMemberCount;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(57) /* metro dependency 57 */;
const channelMemberStore = importDefault(6875) /* metro dependency 6875: ChannelMemberStore */;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_5 = constantsModule.Permissions;
const env0_6 = constantsModule.StatusTypes;
const RegExp = global.RegExp;
const regExp = new RegExp(RegExp('@(:?everyone|here)', ''));
object2 = {shouldShowEveryoneGuard: function(a0, a1) {
importDefault(dependencyMap[4])(a1.getGuildId(), 'isGuildChannel with null guildId');
value = everyoneMemberCount(a0, a1);
value = value > 30;
return value && PermissionStore.can(Permissions.MENTION_EVERYONE, a1);
}, everyoneMemberCount: closure, extractEveryoneRole: function(a0, a1) {
var value4;
var value5;
var value2 = _createForOfIteratorHelperLoose_84373(importDefault(dependencyMap[5]).parsePreprocessor(a1, a0));
var value3 = value2();
if (value3.done) {
return null;
}
var r3 = value3;
loopExit1: while (true) {
value4 = parsedItemUsesEveryoneRole(r3.value);
if (value4 != null) {
break loopExit1;
}
value5 = value2();
if (value5.done) {
return null;
}
r3 = value5;
continue;
}
return value4;
}};
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/MentionGuardUtils.tsx');
exports.default = object2;
}
function _createForOfIteratorHelperLoose_84373(a0, a1) { // fn#84373, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11199:173, offset: 0x01f47771, size: 372 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 _fun84374;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_84375(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_84375(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_84375(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun84374;
}
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 everyoneMemberCount(a0, a1) { // fn#84376, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11199:1122, offset: 0x01f478e5, size: 119 bytes, params: 3, frame: 16
var r0;
const env0_0 = a0;
const value = 0;
if (a1.isThread()) {
r0 = a1.memberCount ?? value;
} else {
ChannelMemberStore.getProps(a1.getGuildId(), a1.id).groups.forEach(_fun84377);
r0 = value;
}
return r0;
}
function parsedItemUsesEveryoneRole(a0) { // fn#84378, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11199:1321, offset: 0x01f479a1, size: 221 bytes, params: 2, frame: 18
var r4;
var r2;
var value2;
var value3;
var done;
var parsedItemUsesEveryoneRoleBinding;
var value4;
var value5;
var value6;
var type;
if (typeof a0.content === 'string') {
type = a0.type;
if (type === 'inlineCode') {
return null;
}
type = a0.type;
if (type === 'codeBlock') {
return null;
}
r2 = a0.content?.match(env0_7);
if (r2 != null) {
return env0_2(r2, 1)[0];
}
} else {
var Array = global.Array;
if (Array.isArray(a0.content)) {
value2 = _createForOfIteratorHelperLoose_84373(a0.content);
value3 = value2();
done = value3.done;
if (done) {
return null;
}
r4 = value3;
loopExit3: while (true) {
parsedItemUsesEveryoneRoleBinding = parsedItemUsesEveryoneRole;
value4 = r4.value;
value5 = parsedItemUsesEveryoneRoleBinding(value4);
if (value5 != null) {
break loopExit3;
}
value6 = value2();
done = value6.done;
if (done) {
return null;
}
r4 = value6;
continue;
}
return value5;
}
}
return null;
}
function _fun84377(a0) { // fn#84377, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11199:1263, offset: 0x01f4795c, size: 69 bytes, params: 2, frame: 5
if (!(env0_0 !== '@everyone' && a0.id === StatusTypes.OFFLINE)) {
env0_1 = env0_1 + a0.count;
}
}
+257
View File
@@ -0,0 +1,257 @@
/* Metro module 13360; source: utils/ModerationUtils.tsx; dependencies: [661, 3831, 696, 13361, 1244, 1314, 2] */
function _fun101730(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#101730, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13550:6, offset: 0x0221d0ba, size: 249 bytes, params: 8, frame: 19
const env0_0 = require;
const closure = mapColorToHighlightColor;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_2 = constantsModule.VerificationLevels;
const env0_3 = constantsModule.VerificationCriteria;
const env0_4 = constantsModule.GuildExplicitContentFilterTypes;
const env0_5 = (require(3831) /* metro dependency 3831: DMSafetyConstants */).ExplicitContentFilterTypes;
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/ModerationUtils.tsx');
exports.mapColorToHighlightColor = closure;
exports.mapOptionToHighlightedRowOptions = function(a0) {
return a0.map(_fun101733);
};
exports.generateVerificationLevelOptions = generateVerificationLevelOptions;
exports.generateContentFilterHighlightedOptions = generateContentFilterHighlightedOptions;
exports.generateContentFilterOptions = generateContentFilterOptions;
exports.generateDmSpamOptions = generateDmSpamOptions;
exports.generateExplicitImageOptions = generateExplicitImageOptions;
}
function mapColorToHighlightColor(a0) { // fn#101731, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13550:227, offset: 0x0221d1b3, size: 408 bytes, params: 2, frame: 15
const HighlightColors = (require(13361) /* metro dependency 13361: HighlightedSettingsTypes */).HighlightColors;
const shimsNativeModule = require(696) /* metro dependency 696: shimsNative */;
if (shimsNativeModule.unsafe_getRawColor('PRIMARY_400') === a0) {
return HighlightColors.ACCENT;
}
const moduleValue2 = shimsNativeModule;
if (moduleValue2.unsafe_getRawColor('GREEN_360') === a0) {
return HighlightColors.GREEN;
}
const moduleValue3 = shimsNativeModule;
if (moduleValue3.unsafe_getRawColor('YELLOW_360') === a0) {
return HighlightColors.YELLOW;
}
const moduleValue4 = shimsNativeModule;
if (moduleValue4.unsafe_getRawColor('ORANGE_345') === a0) {
return HighlightColors.ORANGE;
}
const moduleValue5 = shimsNativeModule;
if (moduleValue5.unsafe_getRawColor('RED_400') === a0) {
return HighlightColors.RED;
}
return HighlightColors.NONE;
}
function mapOptionToHighlightedRowOptions(a0) { // fn#101732, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13550:878, offset: 0x0221d34b, size: 24 bytes, params: 2, frame: 11
return a0.map(function(a0) {
var object = {title: a0.name, description: a0.desc};
object.highlightColor = mapColorToHighlightColor(a0.color);
object.value = a0.value;
object.disabled = a0.disabled;
return object;
});
}
function generateVerificationLevelOptions() { // fn#101734, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13550:1097, offset: 0x0221d3a7, size: 915 bytes, params: 1, frame: 21
let value = a0;
const value2 = a1;
const value3 = undefined;
const r0 = value !== value3 ? value : false;
const r4 = value2 !== value3 ? value2 : false;
let object2 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const PEzffq = t.PEzffq;
object2.name = Reflect.apply(string, intl, [PEzffq]);
string = intl.string;
let r2 = r0 ? Reflect.apply(string, intl, [t.j9WtHx]) : Reflect.apply(string, intl, [t.nDQy0p]);
object2.desc = r2;
const NONE = VerificationLevels.NONE;
object2.value = NONE;
object2.disabled = r0;
const items2 = [object2];
object2 = {};
string = intl.string;
const SsCK8I = t.SsCK8I;
object2.name = Reflect.apply(string, intl, [SsCK8I]);
object2.desc = intl.string(t['8GCOX6']);
const LOW = VerificationLevels.LOW;
object2.value = LOW;
object2.color = r4 ? value3 : (require(696) /* metro dependency 696: shimsNative */).unsafe_getRawColor('GREEN_360');
items2[1] = object2;
object2 = {};
string = intl.string;
const WwNoR4 = t.WwNoR4;
object2.name = Reflect.apply(string, intl, [WwNoR4]);
let formatToPlainString = intl.formatToPlainString;
const VS14ga = t.VS14ga;
const ACCOUNT_AGE = VerificationCriteria.ACCOUNT_AGE;
object2.desc = Reflect.apply(formatToPlainString, intl, [VS14ga, {min: ACCOUNT_AGE}]);
const MEDIUM = VerificationLevels.MEDIUM;
object2.value = MEDIUM;
object2.color = r4 ? value3 : (require(696) /* metro dependency 696: shimsNative */).unsafe_getRawColor('YELLOW_360');
items2[2] = object2;
object2 = {};
string = intl.string;
const I2jMUF = t.I2jMUF;
object2.name = Reflect.apply(string, intl, [I2jMUF]);
formatToPlainString = intl.formatToPlainString;
const property = t['r+b3I4'];
const MEMBER_AGE = VerificationCriteria.MEMBER_AGE;
object2.desc = Reflect.apply(formatToPlainString, intl, [property, {min: MEMBER_AGE}]);
const HIGH = VerificationLevels.HIGH;
object2.value = HIGH;
object2.color = r4 ? value3 : (require(696) /* metro dependency 696: shimsNative */).unsafe_getRawColor('ORANGE_345');
items2[3] = object2;
object2 = {};
object2.name = intl.string(t.cJY8w9);
string = intl.string;
const PWaKme = t.PWaKme;
object2.desc = Reflect.apply(string, intl, [PWaKme]);
const VERY_HIGH = VerificationLevels.VERY_HIGH;
object2.value = VERY_HIGH;
if (r4) {
r2 = value3;
} else {
value = require(696) /* metro dependency 696: shimsNative */;
value = value.unsafe_getRawColor('RED_400');
r2 = value;
}
object2.color = r2;
items2[4] = object2;
return items2;
}
function generateContentFilterHighlightedOptions() { // fn#101735, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13550:2054, offset: 0x0221d73a, size: 543 bytes, params: 1, frame: 20
const value = a0;
const r3 = value !== undefined ? value : false;
let object2 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
object2.name = Reflect.apply(string, intl, [t.iHuPE6]);
object2.desc = intl.string(t['Z+yUWF']);
const ALL_MEMBERS = GuildExplicitContentFilterTypes.ALL_MEMBERS;
object2.value = ALL_MEMBERS;
object2.color = (require(696) /* metro dependency 696: shimsNative */).unsafe_getRawColor('RED_400');
const items2 = [object2];
object2 = {};
object2.name = intl.string(t.ynfFaI);
string = intl.string;
object2.desc = r3 ? Reflect.apply(string, intl, [t.j9WtHx]) : Reflect.apply(string, intl, [t['3fRIN4']]);
const MEMBERS_WITHOUT_ROLES = GuildExplicitContentFilterTypes.MEMBERS_WITHOUT_ROLES;
object2.value = MEMBERS_WITHOUT_ROLES;
object2.disabled = r3;
object2.color = (require(696) /* metro dependency 696: shimsNative */).unsafe_getRawColor('YELLOW_360');
items2[1] = object2;
object2 = {};
string = intl.string;
const VbSyAx = t.VbSyAx;
object2.name = Reflect.apply(string, intl, [VbSyAx]);
string = intl.string;
object2.desc = r3 ? Reflect.apply(string, intl, [t.j9WtHx]) : Reflect.apply(string, intl, [t.M6GNsJ]);
const DISABLED = GuildExplicitContentFilterTypes.DISABLED;
object2.value = DISABLED;
object2.disabled = r3;
object2.color = (require(696) /* metro dependency 696: shimsNative */).unsafe_getRawColor('PRIMARY_400');
items2[2] = object2;
return items2;
}
function generateContentFilterOptions() { // fn#101736, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13550:2727, offset: 0x0221d959, size: 446 bytes, params: 1, frame: 19
const value = a0;
const r2 = value !== undefined ? value : false;
let object2 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
object2.name = Reflect.apply(string, intl, [t.iHuPE6]);
object2.desc = intl.string(t['Z+yUWF']);
const ALL_MEMBERS = GuildExplicitContentFilterTypes.ALL_MEMBERS;
object2.value = ALL_MEMBERS;
const items2 = [object2];
string = intl.string;
const MEMBERS_WITHOUT_ROLES = GuildExplicitContentFilterTypes.MEMBERS_WITHOUT_ROLES;
items2[1] = {name: intl.string(t.ynfFaI), desc: r2 ? Reflect.apply(string, intl, [t.j9WtHx]) : Reflect.apply(string,
intl, [t['3fRIN4']]), value: MEMBERS_WITHOUT_ROLES, disabled: r2};
object2 = {};
string = intl.string;
const VbSyAx = t.VbSyAx;
object2.name = Reflect.apply(string, intl, [VbSyAx]);
string = intl.string;
object2.desc = r2 ? Reflect.apply(string, intl, [t.j9WtHx]) : Reflect.apply(string, intl, [t.M6GNsJ]);
const DISABLED = GuildExplicitContentFilterTypes.DISABLED;
object2.value = DISABLED;
object2.disabled = r2;
items2[2] = object2;
return items2;
}
function generateDmSpamOptions() { // fn#101737, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13550:3243, offset: 0x0221db17, size: 421 bytes, params: 1, frame: 18
let object2 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
object2.name = Reflect.apply(string, intl, [t['4IaoCI']]);
string = intl.string;
const TgipjE = t.TgipjE;
object2.desc = Reflect.apply(string, intl, [TgipjE]);
const DmSpamFilterV2 = (require(1314) /* metro dependency 1314: preloaded_user_settings */).DmSpamFilterV2;
const FRIENDS_AND_NON_FRIENDS = DmSpamFilterV2.FRIENDS_AND_NON_FRIENDS;
object2.value = FRIENDS_AND_NON_FRIENDS;
const items2 = [object2];
object2 = {};
object2.name = intl.string(t['6NnX6F']);
object2.desc = intl.string(t['+dw1qu']);
const NON_FRIENDS = DmSpamFilterV2.NON_FRIENDS;
object2.value = NON_FRIENDS;
items2[1] = object2;
object2 = {};
object2.name = intl.string(t['1tiAFz']);
string = intl.string;
const LKTyeA = t.LKTyeA;
object2.desc = Reflect.apply(string, intl, [LKTyeA]);
const DISABLED = DmSpamFilterV2.DISABLED;
object2.value = DISABLED;
items2[2] = object2;
return items2;
}
function generateExplicitImageOptions() { // fn#101738, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13550:3724, offset: 0x0221dcbc, size: 466 bytes, params: 1, frame: 19
let object2 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const PhNlhz = t.PhNlhz;
object2.name = Reflect.apply(string, intl, [PhNlhz]);
object2.desc = intl.string(t['Fw+Lvp']);
const FRIENDS_AND_NON_FRIENDS = ExplicitContentFilterTypes.FRIENDS_AND_NON_FRIENDS;
object2.value = FRIENDS_AND_NON_FRIENDS;
object2.color = (require(696) /* metro dependency 696: shimsNative */).unsafe_getRawColor('GREEN_360');
const items2 = [object2];
object2 = {};
object2.name = intl.string(t['8ioJ4S']);
object2.desc = intl.string(t.z4l4Cr);
const NON_FRIENDS = ExplicitContentFilterTypes.NON_FRIENDS;
object2.value = NON_FRIENDS;
object2.color = (require(696) /* metro dependency 696: shimsNative */).unsafe_getRawColor('YELLOW_360');
items2[1] = object2;
object2 = {};
string = intl.string;
const FLfuhL = t.FLfuhL;
object2.name = Reflect.apply(string, intl, [FLfuhL]);
string = intl.string;
const MoZlaD = t.MoZlaD;
object2.desc = Reflect.apply(string, intl, [MoZlaD]);
const DISABLED = ExplicitContentFilterTypes.DISABLED;
object2.value = DISABLED;
object2.color = (require(696) /* metro dependency 696: shimsNative */).unsafe_getRawColor('RED_400');
items2[2] = object2;
return items2;
}
+48
View File
@@ -0,0 +1,48 @@
/* Metro module 1458; source: utils/NetworkUtils.tsx; dependencies: [1459, 2] */
function _fun16708(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#16708, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1585:6, offset: 0x00e585df, size: 142 bytes, params: 8, frame: 18
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = [];
object2 = {};
copyDataProperties(object2, (require(1459) /* metro dependency 1459: NetworkUtils */).default, undefined);
object2['awaitOnline'] = function() {
var Promise = global.Promise;
var value = Object.create(Promise.prototype, {constructor: {value: Promise}});
var value2 = new Promise(_fun16710);
return value2 instanceof Object ? value2 : value;
};
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/NetworkUtils.tsx');
exports.default = object2;
}
function awaitOnline_16709() { // fn#16709, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1585:142, offset: 0x00e5866d, size: 37 bytes, params: 1, frame: 11
const Promise = global.Promise;
const value = Object.create(Promise.prototype, {constructor: {value: Promise}});
const promise = new Promise(_fun16710);
return promise instanceof Object ? promise : value;
}
function _fun16710(a0) { // fn#16710, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1585:159, offset: 0x00e58692, size: 126 bytes, params: 2, frame: 15
const closure = whenOnline;
const property = (require(1459) /* metro dependency 1459: NetworkUtils */).default;
if (property.isOnline()) {
return a0();
}
env1_2.push(a0);
if (!env1_3) {
property.addOnlineCallback(closure);
}
}
function whenOnline() { // fn#16711, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1585:228, offset: 0x00e58710, size: 82 bytes, params: 1, frame: 12
const binding = env2_2;
binding.forEach(function(a0) {
return a0();
});
binding.length = 0;
const property = (require(1459) /* metro dependency 1459: NetworkUtils */).default;
property.removeOnlineCallback(whenOnline);
}
+78
View File
@@ -0,0 +1,78 @@
/* Metro module 4617; source: utils/NicknameUtils.tsx; dependencies: [1379, 1945, 3793, 1244, 3995, 566, 2] */
function _fun39640(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#39640, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4795:6, offset: 0x010e735c, size: 201 bytes, params: 8, frame: 22
var object2;
let env0_0 = require;
const closure = getNickname;
const closure2 = getName_39642;
const closure3 = function(a0, a1, a2) {
var env0_0 = a0;
var env0_1 = a1;
var env0_2 = a2;
return require(dependencyMap[5]).useStateFromStores([GuildMemberStore, ChannelStore, RelationshipStore],
_fun39644);
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const guildMemberStore = importDefault(1945) /* metro dependency 1945: GuildMemberStore */;
const relationshipStore = importDefault(3793) /* metro dependency 3793: RelationshipStore */;
object2 = {getNickname: closure, getName: closure2, useName: closure3};
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/NicknameUtils.tsx');
exports.default = object2;
exports.getNickname = closure;
exports.getName = closure2;
exports.useName = closure3;
}
function getNickname(a0, a1, a2) { // fn#39641, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4795:126, offset: 0x010e7425, size: 109 bytes, params: 4, frame: 16
if (a2 != null) {
if (a0 != null) {
return GuildMemberStore.getNick(a0, a2.id);
}
if (a1 == null) {
return null;
}
var channel = ChannelStore.getChannel(a1);
if (channel == null) {
return null;
}
if (channel.isPrivate()) {
return RelationshipStore.getNickname(a2.id);
}
}
return null;
}
function getName_39642(a0, a1, a2) { // fn#39642, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4795:312, offset: 0x010e7492, size: 130 bytes, params: 4, frame: 17
var r0;
var value;
var nickname;
var intl;
if (a2 == null) {
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r0 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.sKdZ6U);
} else {
nickname = getNickname(a0, a1, a2);
if (nickname != null) {
r0 = nickname;
} else {
value = importDefault(3995) /* metro dependency 3995: UserUtils */;
value = value.getName(a2);
r0 = value;
}
}
return r0;
}
function useName_39643(a0, a1, a2) { // fn#39643, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4795:445, offset: 0x010e7514, size: 94 bytes, params: 4, frame: 15
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
return (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildMemberStore, ChannelStore,
RelationshipStore], _fun39644);
}
function _fun39644() { // fn#39644, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4795:512, offset: 0x010e7572, size: 33 bytes, params: 1, frame: 15
return getName_39642(env0_0, require, importDefault);
}
+392
View File
@@ -0,0 +1,392 @@
/* Metro module 6610; source: utils/NotificationSettingsUtils.tsx; dependencies: [6611, 1379, 4814, 4864, 661, 3796, 4865, 670, 1391, 4863, 683, 2] */
function _fun52182(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#52182, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6788:6, offset: 0x01321b2a, size: 981 bytes, params: 8, frame: 26
let env0_0 = require;
const differ = function(a0, a1, a2) {
var env0_0 = a0;
var env0_1 = a1;
var env0_2 = 'RETURN_PREVIOUS_WHEN_CHANGED';
return _fun52184;
};
const closure = function(a0) {
var r0;
var Date;
var end_time;
var value2;
var value = null;
if (value != a0) {
if (value != a0.end_time) {
Date = global.Date;
end_time = a0.end_time;
value2 = new Date();
value2 = value2.getTime();
r0 = value2;
} else {
r0 = value;
}
} else {
r0 = value;
}
return r0;
};
const closure2 = getCurrentGuildSettings;
const closure3 = getCurrentChannelSettings;
let Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const lastMentionTimestampStore = importDefault(6611) /* metro dependency 6611: LastMentionTimestampStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const messageStore = importDefault(4814) /* metro dependency 4814: MessageStore */;
const userGuildSettingsStore = importDefault(4864) /* metro dependency 4864: UserGuildSettingsStore */;
let value = require(661) /* metro dependency 661: Constants */;
const env0_7 = value.AnalyticEvents;
const UserNotificationSettings = value.UserNotificationSettings;
const env0_9 = (require(3796) /* metro dependency 3796: NotificationConstants */).NotificationSettingsUpdateType;
const env0_10 = (require(4865) /* metro dependency 4865: ReadStateConstants */).UnreadSetting;
value = require(670) /* metro dependency 670: UserSettingsConstants */;
const env0_11 = value.ChannelNotificationSettingsFlags;
const env0_12 = value.GuildNotificationSettingsFlags;
const object = {forumThreadsCreated: forumThreadsCreated, suppressEveryone: suppressEveryone,
suppressRoles: suppressRoles, highlights: highlights, mobilePush: mobilePush, optedIn: optedIn,
favorited: favorited, muted: muted, mutedEvents: mutedEvents, unreads: unreads, notifications: notifications};
Object = global.Object;
const freeze = Object.freeze;
const ALL_MESSAGES = UserNotificationSettings.ALL_MESSAGES;
const ONLY_MENTIONS = UserNotificationSettings.ONLY_MENTIONS;
const NO_MESSAGES = UserNotificationSettings.NO_MESSAGES;
const NULL = UserNotificationSettings.NULL;
value = Reflect.apply(freeze, Object, [{[ALL_MESSAGES]: 'All', [ONLY_MENTIONS]: 'Mentions',
[NO_MESSAGES]: 'Nothing', [NULL]: null}]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/NotificationSettingsUtils.tsx');
exports.NotificationLabels = {ForumThreadsCreatedOn: 'enabled forum thread created notifs',
ForumThreadsCreatedOff: 'disabled forum thread created notifs', SuppressEveryoneOn: 'enabled suppress everyone',
SuppressEveryoneOff: 'disabled suppress everyone', SuppressRolesOn: 'enabled suppress roles',
SuppressRolesOff: 'disabled suppress roles', HighlightsOn: 'enabled highlights',
HighlightsOff: 'disabled highlights', MobilePushOn: 'enabled mobile push notifications',
MobilePushOff: 'disabled mobile push notifications', UnreadsAll: 'unreads set to all messages',
UnreadsMentions: 'unreads set to mentions', UnreadsDefault: 'unreads set to the default',
NotificationsAll: 'notifications set to all messages', NotificationsMentions: 'notifications set to mentions',
NotificationsNothing: 'notifications set to nothing', NotificationsDefault: 'notifications set to the default',
PresetAll: 'notification preset set to all messages', PresetMentions: 'notification preset set to mentions',
PresetNothing: 'notification preset set to nothing', PresetDefault: 'notification preset set to the default',
OptedIn: 'opted in to entity', OptedOut: 'opted out from entity', Favorited: 'favorited',
UnFavorited: 'unfavorited', Muted: 'muted', Unmuted: 'unmuted', MutedScheduledEvents: 'muted scheduled events',
UnmutedScheduledEvents: 'unmuted scheduled events', OverrideCreated: 'channel override created',
OverrideDeleted: 'channel override deleted',
AnnouncementAutoEnable: 'announcement channels auto set to all messages'};
exports.NotificationLabel = object;
exports.MessageNotificationSettings = value;
exports.trackGuildNotificationSettingsUpdate = trackGuildNotificationSettingsUpdate;
exports.muteConfigToTimestamp = closure;
exports.trackChannelNotificationSettingsUpdate = trackChannelNotificationSettingsUpdate;
exports.getCurrentGuildSettings = closure2;
exports.getManyCurrentGuildSettings = function(a0) {
var Map = global.Map;
var value2 = new Map();
var env0_0 = value2;
a0.forEach(_fun52204);
return value2;
};
exports.getCurrentChannelSettings = closure3;
exports.getManyCurrentChannelSettings = function(a0, a1) {
var env0_0 = a0;
var Map = global.Map;
var value2 = new Map();
var env0_1 = value2;
a1.forEach(_fun52206);
return value2;
};
exports.trackAccountNotificationSettingUpdated = function(a0, a1) {
var defaultImport = importDefault(dependencyMap[10]);
var NOTIFICATION_SETTINGS_UPDATED = AnalyticEvents.NOTIFICATION_SETTINGS_UPDATED;
defaultImport.track(NOTIFICATION_SETTINGS_UPDATED, {update_type: NotificationSettingsUpdateType.ACCOUNT,
quiet_mode_enabled: a0.quietMode, quiet_mode_enabled_old: a1.quietMode});
};
}
function differ(a0, a1, a2) { // fn#52183, offset: 0x01321eff, size: 33 bytes, params: 4, frame: 2
const env0_0 = a0;
const env0_1 = a1;
return _fun52184;
}
function getCurrentGuildSettings(a0) { // fn#52186, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6788:2896, offset: 0x01321fa3, size: 268 bytes, params: 2, frame: 15
var r2;
var end_time;
var Date;
var value4;
var date;
const isMuted2 = UserGuildSettingsStore.isMuted(a0);
const muteConfig = UserGuildSettingsStore.getMuteConfig(a0);
const object2 = {};
object2.guild_suppress_everyone = UserGuildSettingsStore.isSuppressEveryoneEnabled(a0);
object2.guild_suppress_roles = UserGuildSettingsStore.isSuppressRolesEnabled(a0);
object2.guild_scheduled_events_muted = UserGuildSettingsStore.isMuteScheduledEventsEnabled(a0);
object2.guild_is_muted = isMuted2;
const value3 = null;
if (value3 != muteConfig) {
end_time = muteConfig.end_time;
if (value3 != end_time) {
Date = global.Date;
end_time = muteConfig.end_time;
value4 = Object.create(Date.prototype, {constructor: {value: Date}});
date = new Date();
r2 = (date instanceof Object ? date : value4).getTime();
} else {
r2 = value3;
}
} else {
r2 = value3;
}
object2.guild_muted_until = r2;
object2.guild_receive_mobile_push = UserGuildSettingsStore.isMobilePushEnabled(a0);
const binding = env0_14;
const getMessageNotifications = UserGuildSettingsStore.getMessageNotifications;
object2.guild_message_notification_settings = binding[Reflect.apply(getMessageNotifications, UserGuildSettingsStore,
[a0])];
object2.guild_notify_highlights = UserGuildSettingsStore.getNotifyHighlights(a0);
object2.guild_flags = UserGuildSettingsStore.getGuildFlags(a0);
return object2;
}
function getCurrentChannelSettings(a0, a1) { // fn#52187, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6788:3443, offset: 0x013220af, size: 175 bytes, params: 3, frame: 17
var r2;
var end_time;
var Date;
var value4;
var date;
const isChannelMuted2 = UserGuildSettingsStore.isChannelMuted(a0, a1);
const channelMuteConfig = UserGuildSettingsStore.getChannelMuteConfig(a0, a1);
const object2 = {channel_is_muted: isChannelMuted2};
const value3 = null;
if (value3 != channelMuteConfig) {
end_time = channelMuteConfig.end_time;
if (value3 != end_time) {
Date = global.Date;
end_time = channelMuteConfig.end_time;
value4 = Object.create(Date.prototype, {constructor: {value: Date}});
date = new Date();
r2 = (date instanceof Object ? date : value4).getTime();
} else {
r2 = value3;
}
} else {
r2 = value3;
}
object2.channel_muted_until = r2;
const binding = env0_14;
const getChannelMessageNotifications = UserGuildSettingsStore.getChannelMessageNotifications;
object2.channel_message_notification_settings = binding[Reflect.apply(getChannelMessageNotifications,
UserGuildSettingsStore, [a0, a1])];
object2.channel_flags = UserGuildSettingsStore.getChannelIdFlags(a0, a1);
return object2;
}
function forumThreadsCreated(a0) { // fn#52188, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6788:1878, offset: 0x0132215e, size: 29 bytes, params: 2, frame: 3
const binding = env0_13;
return a0 ? binding.ForumThreadsCreatedOn : binding.ForumThreadsCreatedOff;
}
function suppressEveryone(a0) { // fn#52189, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6788:1949, offset: 0x0132217b, size: 29 bytes, params: 2, frame: 3
const binding = env0_13;
return a0 ? binding.SuppressEveryoneOn : binding.SuppressEveryoneOff;
}
function suppressRoles(a0) { // fn#52190, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6788:2011, offset: 0x01322198, size: 29 bytes, params: 2, frame: 3
const binding = env0_13;
return a0 ? binding.SuppressRolesOn : binding.SuppressRolesOff;
}
function highlights(a0) { // fn#52191, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6788:2064, offset: 0x013221b5, size: 29 bytes, params: 2, frame: 3
const binding = env0_13;
return a0 ? binding.HighlightsOn : binding.HighlightsOff;
}
function mobilePush(a0) { // fn#52192, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6788:2111, offset: 0x013221d2, size: 29 bytes, params: 2, frame: 3
const binding = env0_13;
return a0 ? binding.MobilePushOn : binding.MobilePushOff;
}
function optedIn(a0) { // fn#52193, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6788:2155, offset: 0x013221ef, size: 29 bytes, params: 2, frame: 3
const binding = env0_13;
return a0 ? binding.OptedIn : binding.OptedOut;
}
function favorited(a0) { // fn#52194, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6788:2191, offset: 0x0132220c, size: 29 bytes, params: 2, frame: 3
const binding = env0_13;
return a0 ? binding.Favorited : binding.UnFavorited;
}
function muted(a0) { // fn#52195, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6788:2228, offset: 0x01322229, size: 29 bytes, params: 2, frame: 3
const binding = env0_13;
return a0 ? binding.Muted : binding.Unmuted;
}
function mutedEvents(a0) { // fn#52196, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6788:2263, offset: 0x01322246, size: 29 bytes, params: 2, frame: 3
const binding = env0_13;
return a0 ? binding.MutedScheduledEvents : binding.UnmutedScheduledEvents;
}
function unreads(a0) { // fn#52197, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6788:2324, offset: 0x01322263, size: 70 bytes, params: 2, frame: 3
const ALL_MESSAGES = UnreadSetting.ALL_MESSAGES;
return a0 === ALL_MESSAGES ? env0_13.UnreadsAll : a0 === UnreadSetting.ONLY_MENTIONS ? env0_13.UnreadsMentions : env0_13.UnreadsDefault;
}
function notifications(a0) { // fn#52198, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6788:2428, offset: 0x013222a9, size: 96 bytes, params: 2, frame: 3
const ALL_MESSAGES = UserNotificationSettings.ALL_MESSAGES;
return a0 === ALL_MESSAGES ? env0_13.NotificationsAll : a0 === UserNotificationSettings.ONLY_MENTIONS ? env0_13.NotificationsMentions : a0 === UserNotificationSettings.NO_MESSAGES ? env0_13.NotificationsNothing : env0_13.NotificationsDefault;
}
function trackGuildNotificationSettingsUpdate(a0, a1, a2, a3, a4) { // fn#52199, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6788:3954, offset: 0x01322309, size: 451 bytes, params: 6, frame: 23
const closure = trackGuildNotificationSettingsUpdateCompute;
let value = closure(a2);
const value4 = closure(getCurrentGuildSettings(a0), a1);
value = differ(value, value4, 'RETURN_PREVIOUS_WHEN_CHANGED');
const value5 = value('guild_flags');
const value6 = 0;
const value7 = (value4.guild_flags ?? value6) ^ (value5 ?? value6);
const flagUtilsModule = require(1391) /* metro dependency 1391: FlagUtils */;
const removeFlags = flagUtilsModule.removeFlags;
const OPT_IN_CHANNELS_OFF = GuildNotificationSettingsFlags.OPT_IN_CHANNELS_OFF;
const OPT_IN_CHANNELS_ON = GuildNotificationSettingsFlags.OPT_IN_CHANNELS_ON;
const value8 = Reflect.apply(removeFlags, flagUtilsModule, [value7, OPT_IN_CHANNELS_OFF, OPT_IN_CHANNELS_ON]);
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
const trackWithMetadata = defaultImport.trackWithMetadata;
const NOTIFICATION_SETTINGS_UPDATED = AnalyticEvents.NOTIFICATION_SETTINGS_UPDATED;
const object2 = {};
copyDataProperties(object2, value4, undefined);
const getStats = LastMentionTimestampStore.getStats;
copyDataProperties(object2, Reflect.apply(getStats, LastMentionTimestampStore, [a0]), undefined);
object2['location'] = a4;
object2['guild_id'] = a0;
const GUILD = NotificationSettingsUpdateType.GUILD;
object2['update_type'] = GUILD;
object2['label'] = a3;
object2['guild_flags_old'] = value('guild_flags');
object2['guild_is_muted_old'] = value('guild_is_muted');
object2['guild_suppress_roles_old'] = value('guild_suppress_roles');
object2['guild_notify_highlights_old'] = value('guild_notify_highlights');
object2['guild_suppress_everyone_old'] = value('guild_suppress_everyone');
object2['guild_receive_mobile_push_old'] = value('guild_receive_mobile_push');
object2['guild_scheduled_events_muted_old'] = value('guild_scheduled_events_muted');
value = value('guild_message_notification_settings');
object2['guild_message_notification_settings_old'] = value;
object2['is_opt_in_only_change'] = value6 === value8;
Reflect.apply(trackWithMetadata, defaultImport, [NOTIFICATION_SETTINGS_UPDATED, object2]);
}
function trackChannelNotificationSettingsUpdate({updateType = NotificationSettingsUpdateType.CHANNEL, guildId, channelId, applicationId, change, previous, label, location}) { // fn#52201, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6788:5783, offset: 0x013225f3, size: 548 bytes, params: 2, frame: 30
const closure = trackChannelNotificationSettingsUpdateCompute;
const value3 = closure(previous);
const value5 = closure(getCurrentChannelSettings(guildId, channelId), change);
const value6 = differ(value3, value5, 'RETURN_PREVIOUS_WHEN_CHANGED');
const channel = ChannelStore.getChannel(channelId);
const value11 = (value5.channel_flags ?? 0) ^ (value6('channel_flags') ?? 0);
const flagUtilsModule = require(1391) /* metro dependency 1391: FlagUtils */;
const removeFlags = flagUtilsModule.removeFlags;
const FAVORITED = ChannelNotificationSettingsFlags.FAVORITED;
const OPT_IN_ENABLED = ChannelNotificationSettingsFlags.OPT_IN_ENABLED;
const value12 = Reflect.apply(removeFlags, flagUtilsModule, [value11, FAVORITED, OPT_IN_ENABLED]);
const r7 = MessageStore.getLastMessage(channelId)?.type ?? null;
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
const trackWithMetadata = defaultImport.trackWithMetadata;
const NOTIFICATION_SETTINGS_UPDATED = AnalyticEvents.NOTIFICATION_SETTINGS_UPDATED;
const object2 = {};
copyDataProperties(object2, value5, undefined);
const getStats = LastMentionTimestampStore.getStats;
copyDataProperties(object2, Reflect.apply(getStats, LastMentionTimestampStore, [guildId]), undefined);
object2['location'] = location;
object2['guild_id'] = guildId;
object2['channel_id'] = channelId;
object2['update_type'] = updateType;
object2['label'] = label;
object2['parent_id'] = channel != null ? channel.parent_id : null;
object2['channel_flags_old'] = value6('channel_flags');
object2['channel_is_muted_old'] = value6('channel_is_muted');
object2['channel_muted_until_old'] = value6('channel_muted_until');
object2['channel_is_overridden_old'] = value6('channel_is_overridden');
object2['channel_message_notification_settings_old'] = value6('channel_message_notification_settings');
object2['is_opt_in_only_change'] = value12 === 0;
object2['last_message_type'] = r7;
object2['application_id'] = applicationId;
Reflect.apply(trackWithMetadata, defaultImport, [NOTIFICATION_SETTINGS_UPDATED, object2]);
}
function getManyCurrentGuildSettings(a0) { // fn#52203, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6788:7289, offset: 0x013228db, size: 54 bytes, params: 2, frame: 12
const Map = global.Map;
const map = new Map();
a0.forEach(_fun52204);
return map;
}
function getManyCurrentChannelSettings(a0, a1) { // fn#52205, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6788:7491, offset: 0x01322936, size: 61 bytes, params: 3, frame: 12
const env0_0 = a0;
const Map = global.Map;
const map = new Map();
a1.forEach(_fun52206);
return map;
}
function _fun52184(a0) { // fn#52184, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6788:2719, offset: 0x01321f20, size: 56 bytes, params: 2, frame: 5
if (env0_2 === 'RETURN_PREVIOUS_WHEN_CHANGED') {
return env0_0[a0] === require[a0] ? undefined : env0_0[a0];
}
}
function trackGuildNotificationSettingsUpdateCompute(a0) { // fn#52200, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6788:4019, owner: trackGuildNotificationSettingsUpdate.compute, offset: 0x013224cc, size: 295 bytes, params: 2, frame: 15
var r5;
var end_time;
var Date;
var date;
const value = a1;
const r1 = value !== undefined ? value : {};
if (r1.mute_config == null) {
r5 = a0.guild_muted_until;
} else {
end_time = r1.mute_config.end_time;
if (end_time != null) {
Date = global.Date;
end_time = r1.mute_config.end_time;
date = new Date();
date = date.getTime();
r5 = date;
} else {
r5 = a0.guild_muted_until;
}
}
return {guild_muted_until: r5, guild_flags: r1.flags ?? a0.guild_flags,
guild_is_muted: r1.muted ?? a0.guild_is_muted,
guild_message_notification_settings: r1.message_notifications != null ? env1_14[r1.message_notifications] : a0.guild_message_notification_settings,
guild_suppress_roles: r1.suppress_roles ?? a0.guild_suppress_roles,
guild_receive_mobile_push: r1.mobile_push ?? a0.guild_receive_mobile_push,
guild_notify_highlights: r1.notify_highlights ?? a0.guild_notify_highlights,
guild_suppress_everyone: r1.suppress_everyone ?? a0.guild_suppress_everyone,
guild_scheduled_events_muted: r1.mute_scheduled_events ?? a0.guild_scheduled_events_muted};
}
function trackChannelNotificationSettingsUpdateCompute(a0) { // fn#52202, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6788:5946, owner: trackChannelNotificationSettingsUpdate.compute, offset: 0x01322817, size: 196 bytes, params: 2, frame: 17
let value = a1;
const value2 = undefined;
const r1 = value !== value2 ? value : {};
const muted = r1.muted;
value = null;
const r8 = value != muted ? muted : value == a0 ? value2 : a0.channel_is_muted;
const r2 = value != r1.message_notifications ? env1_14[r1.message_notifications] : value == a0 ? value2 : a0.channel_message_notification_settings;
const object2 = {channel_is_muted: r8};
object2.channel_is_overridden = value == guildId ? value : r8 === true || value != r2;
const flags = r1.flags;
object2.channel_flags = value != flags ? flags : value == a0 ? value2 : a0.channel_flags;
object2.channel_message_notification_settings = r2;
value = environment.__proto__;
object2.channel_muted_until = muteConfigToTimestamp(r1.mute_config);
return object2;
}
function _fun52204(a0) { // fn#52204, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6788:7361, offset: 0x01322911, size: 37 bytes, params: 2, frame: 14
const binding = env0_0;
return binding.set(a0, getCurrentGuildSettings(a0));
}
function _fun52206(a0) { // fn#52206, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6788:7567, offset: 0x01322973, size: 42 bytes, params: 2, frame: 15
const binding = env0_1;
return binding.set(a0, getCurrentChannelSettings(env0_0, a0));
}
+76
View File
@@ -0,0 +1,76 @@
/* Metro module 1856; source: utils/NumberUtils.tsx; dependencies: [1244, 2] */
function _fun20018(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#20018, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1983:6, offset: 0x00ebc806, size: 127 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/NumberUtils.tsx');
exports.shortenAndLocalizeNumber = shortenAndLocalizeNumber;
exports.humanizeValue = humanizeValue;
exports.parseInteger = function(a0) {
var r0;
var value = a1;
r0 = value !== undefined ? value : global.NaN;
if (a0 == null) {
return r0;
}
value = (0, global.parseInt)(a0);
return global.Number.isNaN(value) ? r0 : value;
};
exports.formatPercent = function(a0, a1) {
var r0;
var object;
var value = a2;
r0 = value !== undefined ? value : {};
var Intl = global.Intl;
object = {'style': 'percent', 'minimumFractionDigits': 0};
copyDataProperties(object, r0, Intl);
return Intl.NumberFormat(a0, object).format(a1);
};
}
function shortenAndLocalizeNumber(a0) { // fn#20019, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1983:184, offset: 0x00ebc885, size: 167 bytes, params: 2, frame: 17
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
if (a0 < 1000000) {
return intl.formatToPlainString(t.OiHat3, {value: a0});
}
let value = a0 / 1000000;
value = value.toFixed(1);
const formatToPlainString = intl.formatToPlainString;
const Iku48I = t.Iku48I;
return Reflect.apply(formatToPlainString, intl, [Iku48I, {value: value}]);
}
function humanizeValue(a0, a1) { // fn#20020, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1983:404, offset: 0x00ebc92c, size: 369 bytes, params: 3, frame: 18
var object2;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var formatToPlainString;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var property;
var OiHat3;
if (a0 < 1000) {
formatToPlainString = intl.formatToPlainString;
OiHat3 = t.OiHat3;
object2 = {};
object2.value = global.Math.floor(a0);
return Reflect.apply(formatToPlainString, intl, [OiHat3, object2]);
}
if (a0 < 1000000) {
formatToPlainString = intl.formatToPlainString;
property = t['84R4Tc'];
object2 = {};
object2.value = global.Math.floor(a0 / 1000);
return Reflect.apply(formatToPlainString, intl, [property, object2]);
}
const Math = global.Math;
let value = Math.floor(10 * a0 / 1000000) / 10;
const Intl = global.Intl;
const NumberFormat = Intl.NumberFormat;
const value2 = Object.create(NumberFormat.prototype, {constructor: {value: NumberFormat}});
const numberFormat = new NumberFormat(a1, {maximumFractionDigits: 1});
value = (numberFormat instanceof Object ? numberFormat : value2).format(value);
formatToPlainString = intl.formatToPlainString;
const Iku48I = t.Iku48I;
return Reflect.apply(formatToPlainString, intl, [Iku48I, {value: value}]);
}
+47
View File
@@ -0,0 +1,47 @@
/* Metro module 4283; source: utils/PathUtils.tsx; dependencies: [477, 2] */
function _fun36330(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#36330, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4455:6, offset: 0x01089372, size: 124 bytes, params: 8, frame: 19
const env0_0 = require;
const closure = function(a0, a1) {
var r4;
var value = a0;
var value2 = value.split(RegExp('[/\\\\]', ''));
r4 = value2[value2.length - 1] === '' ? value : value2[value2.length - 1];
return a1 != null && r4.endsWith(a1) ? r4.slice(0, -a1.length) : r4;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/PathUtils.tsx');
exports.pathJoin = function(a0) {
var r3;
var r2;
var value = copyRestArgs(0, r3);
r2 = require(dependencyMap[0]).isWindows() ? '\\' : '/';
value = value.filter(_fun36333);
return value.join(r2);
};
exports.pathBasename = closure;
exports.pathFilenameWithoutExt = pathFilenameWithoutExt;
}
function pathJoin(a0) { // fn#36332, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4455:301, offset: 0x01089462, size: 80 bytes, params: 2, frame: 12
let value = copyRestArgs(0, undefined);
const r2 = (require(477) /* metro dependency 477: PlatformUtils */).isWindows() ? '\\' : '/';
value = value.filter(function(a0) {
return a0.length > 0;
});
return value.join(r2);
}
function pathFilenameWithoutExt(a0) { // fn#36334, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4455:455, offset: 0x010894b2, size: 54 bytes, params: 2, frame: 14
var r0;
var value;
const value2 = pathBasename(a0).lastIndexOf('.');
if (value2 <= 0) {
r0 = value;
} else {
value = value.slice(0, value2);
r0 = value;
}
return r0;
}
+9
View File
@@ -0,0 +1,9 @@
/* Metro module 4615; source: utils/PerceptualVolumeUtils.tsx; dependencies: [2, 4616] */
function _fun39636(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#39636, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4793:6, offset: 0x010e71a9, size: 117 bytes, params: 8, frame: 17
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/PerceptualVolumeUtils.tsx');
exports.perceptualToAmplitude = (require(4616) /* metro dependency 4616: PerceptualVolumeUtils */).perceptualToAmplitude;
exports.amplitudeToPerceptual = (require(4616) /* metro dependency 4616: PerceptualVolumeUtils */).amplitudeToPerceptual;
}
+458
View File
@@ -0,0 +1,458 @@
/* Metro module 15192; source: utils/PermissionSpecUtils.tsx; dependencies: [1383, 1867, 661, 8120, 15193, 6841, 6636, 15194, 1244, 1948, 6860, 4809, 15195, 6859, 15196, 9112, 7155, 2] */
function _fun116173(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#116173, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15389:6, offset: 0x0247de90, size: 295 bytes, params: 8, frame: 19
var object2;
let env0_0 = require;
const conditionalPermissionSpec = function(a0, a1) {
return a0 ? [a1()] : [];
};
const filterPermissions = function(a0, a1) {
var r0;
var value = a0;
var env0_0 = a1;
if (a1.size === 0) {
r0 = value;
} else {
value = value.map(_fun116177);
r0 = value;
}
return r0;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_4 = (require(1383) /* metro dependency 1383: ChannelRecord */).VOICE_THREAD_PARENT_CHANNEL_TYPES;
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_6 = constantsModule.HelpdeskArticles;
const env0_7 = constantsModule.ChannelTypes;
const env0_8 = constantsModule.GuildFeatures;
const env0_9 = constantsModule.Permissions;
const env0_10 = constantsModule.GuildSettingsSections;
const env0_11 = (require(8120) /* metro dependency 8120: ChannelPermissionsConstants */).getChannelPermissionSpecMap;
object2 = {generateChannelPermissionSpec: generateChannelPermissionSpec,
generateGuildPermissionSpec: generateGuildPermissionSpec, getGuildPermissionSpecMap: function(a0) {
return importAll(dependencyMap[14]).getGuildPermissionSpec(getPermissionOptions(a0.id));
}};
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/PermissionSpecUtils.tsx');
exports.default = object2;
}
function getPermissionOptions(a0) { // fn#116174, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15389:296, offset: 0x0247dfb7, size: 414 bytes, params: 2, frame: 26
var object2;
const isGuildEligibleForStageChannels2 = (require(15193) /* metro dependency 15193: useGuildEligibleForStageChannels */).isGuildEligibleForStageChannels(a0);
const guild = GuildStore.getGuild(a0);
const r3 = guild != null && (require(6841) /* metro dependency 6841: useIsCreatorMonetizationEnabledGuild */).isCreatorMonetizationEnabledGuild(guild);
const soundmojiRenderingExperiment = (require(6636) /* metro dependency 6636: SoundmojiRenderingExperiment */).getSoundmojiRenderingExperiment({location: 'getPermissionOptions'});
const hangoutWindowExperimentModule = require(15194) /* metro dependency 15194: HangoutWindowExperiment */;
const getHangoutWindowExperiment = hangoutWindowExperimentModule.getHangoutWindowExperiment;
const enableHangoutWindow = Reflect.apply(getHangoutWindowExperiment, hangoutWindowExperimentModule, [{guildId: a0,
location: 'getPermissionOptions'}]).enableHangoutWindow;
object2 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let format = intl.format;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const ZuzwPz = t.ZuzwPz;
const intl2 = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl2.string;
const DkSwJ2 = t.DkSwJ2;
object2.PRIORITY_SPEAKER_DESCRIPTION = Reflect.apply(format, intl, [ZuzwPz, {keybind: Reflect.apply(string, intl2,
[DkSwJ2])}]);
format = intl.format;
const fVE8y8 = t.fVE8y8;
const defaultImport = importDefault(1948) /* metro dependency 1948: HelpdeskUtils */;
const getArticleURL = defaultImport.getArticleURL;
const SOUNDBOARD = HelpdeskArticles.SOUNDBOARD;
object2.SOUNDBOARD_DESCRIPTION = Reflect.apply(format, intl, [fVE8y8,
{helpCenterArticle: Reflect.apply(getArticleURL, defaultImport, [SOUNDBOARD])}]);
object2.showStageChannelPermissions = isGuildEligibleForStageChannels2;
object2.showExperimental = true;
object2.showMembershipManualApprovalPermissions = true;
object2.showCreatorMonetizationAnalyticsPermission = r3;
object2.inSoundmojiExperiment = soundmojiRenderingExperiment;
object2.enableHangoutWindow = enableHangoutWindow;
return object2;
}
function filterPermissions(a0, a1) { // fn#116176, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15389:1111, offset: 0x0247e177, size: 45 bytes, params: 3, frame: 13
var r0;
let value = a0;
const env0_0 = a1;
if (a1.size === 0) {
r0 = value;
} else {
value = value.map(function(a0) {
var r3;
var object = {};
copyDataProperties(object, a0, r3);
object['permissions'] = a0.permissions.filter(_fun116178);
return object;
});
r0 = value;
}
return r0;
}
function generateChannelPermissionSpec(a0, a1, a2, a3) { // fn#116179, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15389:1286, offset: 0x0247e1ff, size: 3036 bytes, params: 5, frame: 34
var r23;
var r13;
var r22;
var r14;
var defaultImport;
var add;
var MANAGE_OFFICIAL_MESSAGES;
var moduleValue3;
var generateChannelGeneralSection;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var moduleValue4;
var generateChannelMembershipSection;
var moduleValue5;
var generateChannelTextSection;
var moduleValue6;
var generateChannelAppsSection;
var moduleValue7;
var moduleValue8;
var moduleValue9;
var format;
var closure;
var moduleValue10;
var moduleValue11;
var value18;
var moduleValue12;
var moduleValue13;
var generateChannelStageVoiceSection;
var moduleValue14;
var generateChannelStageSection;
var moduleValue15;
var generateChannelEventsSection;
var moduleValue16;
var moduleValue17;
var moduleValue18;
var value23;
var moduleValue19;
var moduleValue20;
var generateChannelVoiceSection;
var moduleValue21;
var moduleValue22;
var moduleValue23;
var moduleValue24;
var moduleValue25;
var moduleValue26;
var moduleValue27;
var moduleValue28;
var value30;
var moduleValue29;
const env0_0 = a0;
const getPermissionOptionsBinding = getPermissionOptions;
const value2 = undefined;
const permissionOptionsBinding = getPermissionOptionsBinding(a0);
const getChannelPermissionSpecMapBinding = getChannelPermissionSpecMap;
let object = {};
copyDataProperties(object, a3, undefined);
object['enableHangoutWindow'] = permissionOptionsBinding.enableHangoutWindow;
const channelPermissionSpecMapBinding = getChannelPermissionSpecMapBinding(a1, a2, object);
const VoiceInThreadsExperiment = (require(6860) /* metro dependency 6860: ThreadHooks */).VoiceInThreadsExperiment;
const getCurrentConfig = VoiceInThreadsExperiment.getCurrentConfig;
const r8 = Reflect.apply(getCurrentConfig, VoiceInThreadsExperiment, [{guildId: a0,
location: '3ad37d_1'}]).enabled && VOICE_THREAD_PARENT_CHANNEL_TYPES.has(a1.type);
const isStageVideoEnabled2 = (require(4809) /* metro dependency 4809: StageMediaHooks */).isStageVideoEnabled(a0);
const canCurrentUserManageMessageFilters2 = (require(15195) /* metro dependency 15195: PermissionUtils */).canCurrentUserManageMessageFilters(a0);
const isMediaChannel2 = a1.isMediaChannel();
const Set = global.Set;
const set = new Set();
const guild = GuildStore.getGuild(a0);
let r1 = guild == null ? value2 : guild.features.has(GuildFeatures.VERIFIED);
if (r1) {
defaultImport = importDefault(6859) /* metro dependency 6859: GuildOfficialMessagesExperiment */;
r1 = defaultImport.getCurrentConfig({guildId: a0, location: 'generateChannelPermissionSpec'}).enabled;
}
if (!r1) {
add = set.add;
MANAGE_OFFICIAL_MESSAGES = Permissions.MANAGE_OFFICIAL_MESSAGES;
Reflect.apply(add, set, [MANAGE_OFFICIAL_MESSAGES.toString()]);
}
const inSoundmojiExperiment = permissionOptionsBinding.inSoundmojiExperiment;
const type = a1.type;
const GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
if (GUILD_CATEGORY === type) {
moduleValue24 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
generateChannelGeneralSection = moduleValue24.generateChannelGeneralSection;
string = intl.string;
object = [Reflect.apply(generateChannelGeneralSection, moduleValue24, [channelPermissionSpecMapBinding,
Reflect.apply(string, intl, [t['AkPxc+']])])];
moduleValue25 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
generateChannelMembershipSection = moduleValue25.generateChannelMembershipSection;
string = intl.string;
object[1] = Reflect.apply(generateChannelMembershipSection, moduleValue25, [channelPermissionSpecMapBinding,
Reflect.apply(string, intl, [t.Ny49TN])]);
moduleValue26 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
object[2] = moduleValue26.generateChannelTextSection(channelPermissionSpecMapBinding, intl.string(t.cKobO5),
{'showPrivateThreads': true, 'showCreateThreads': true, inSoundmojiExperiment: inSoundmojiExperiment});
moduleValue27 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
generateChannelVoiceSection = moduleValue27.generateChannelVoiceSection;
string = intl.string;
object[3] = Reflect.apply(generateChannelVoiceSection, moduleValue27, [channelPermissionSpecMapBinding,
Reflect.apply(string, intl, [t['46Ra1b']])]);
moduleValue28 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
generateChannelAppsSection = moduleValue28.generateChannelAppsSection;
string = intl.string;
object[4] = Reflect.apply(generateChannelAppsSection, moduleValue28, [channelPermissionSpecMapBinding,
Reflect.apply(string, intl, [t['rrh/W6']])]);
value30 = arraySpread(object, conditionalPermissionSpec(permissionOptionsBinding.showStageChannelPermissions,
_fun116180), 5, r23);
moduleValue29 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
generateChannelEventsSection = moduleValue29.generateChannelEventsSection;
string = intl.string;
object[value30] = Reflect.apply(generateChannelEventsSection, moduleValue29, [channelPermissionSpecMapBinding,
Reflect.apply(string, intl, [t.b8lplT])]);
value30 + 1;
r1 = object;
} else if (ChannelTypes.GUILD_VOICE === type) {
moduleValue18 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
generateChannelGeneralSection = moduleValue18.generateChannelGeneralSection;
value23 = intl.string(t.ouHggI);
object = {showManageWebhooks: true};
object = [Reflect.apply(generateChannelGeneralSection, moduleValue18, [channelPermissionSpecMapBinding, value23,
object])];
moduleValue19 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
generateChannelMembershipSection = moduleValue19.generateChannelMembershipSection;
string = intl.string;
object[1] = Reflect.apply(generateChannelMembershipSection, moduleValue19, [channelPermissionSpecMapBinding,
Reflect.apply(string, intl, [t.Ny49TN])]);
moduleValue20 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
generateChannelVoiceSection = moduleValue20.generateChannelVoiceSection;
string = intl.string;
object[2] = Reflect.apply(generateChannelVoiceSection, moduleValue20, [channelPermissionSpecMapBinding,
Reflect.apply(string, intl, [t['46Ra1b']])]);
moduleValue21 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
object[3] = moduleValue21.generateChannelVoiceChatSection(channelPermissionSpecMapBinding,
intl.string(t.iqlsnD),
{sectionDescription: canCurrentUserManageMessageFilters2 ? intl.format(t['4Z9Fbb'],
{setUpAutomod: setUpAutomod_116181}) : value2, inSoundmojiExperiment: inSoundmojiExperiment});
moduleValue22 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
generateChannelEventsSection = moduleValue22.generateChannelEventsSection;
string = intl.string;
object[4] = Reflect.apply(generateChannelEventsSection, moduleValue22, [channelPermissionSpecMapBinding,
Reflect.apply(string, intl, [t.b8lplT])]);
moduleValue23 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
generateChannelAppsSection = moduleValue23.generateChannelAppsSection;
string = intl.string;
object[5] = Reflect.apply(generateChannelAppsSection, moduleValue23, [channelPermissionSpecMapBinding,
Reflect.apply(string, intl, [t['rrh/W6']])]);
r1 = object;
} else if (ChannelTypes.GUILD_STAGE_VOICE === type) {
moduleValue11 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
generateChannelGeneralSection = moduleValue11.generateChannelGeneralSection;
value18 = intl.string(t.ouHggI);
object = {showManageWebhooks: false};
object = [Reflect.apply(generateChannelGeneralSection, moduleValue11, [channelPermissionSpecMapBinding, value18,
object])];
moduleValue12 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
generateChannelMembershipSection = moduleValue12.generateChannelMembershipSection;
string = intl.string;
object[1] = Reflect.apply(generateChannelMembershipSection, moduleValue12, [channelPermissionSpecMapBinding,
Reflect.apply(string, intl, [t.Ny49TN])]);
moduleValue13 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
generateChannelStageVoiceSection = moduleValue13.generateChannelStageVoiceSection;
string = intl.string;
object[2] = Reflect.apply(generateChannelStageVoiceSection, moduleValue13, [channelPermissionSpecMapBinding,
Reflect.apply(string, intl, [t['46Ra1b']]), isStageVideoEnabled2]);
moduleValue14 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
generateChannelStageSection = moduleValue14.generateChannelStageSection;
string = intl.string;
object[3] = Reflect.apply(generateChannelStageSection, moduleValue14, [channelPermissionSpecMapBinding,
Reflect.apply(string, intl, [t.yniauk])]);
moduleValue15 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
generateChannelEventsSection = moduleValue15.generateChannelEventsSection;
string = intl.string;
object[4] = Reflect.apply(generateChannelEventsSection, moduleValue15, [channelPermissionSpecMapBinding,
Reflect.apply(string, intl, [t.b8lplT])]);
moduleValue16 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
object[5] = moduleValue16.generateChannelVoiceChatSection(channelPermissionSpecMapBinding,
intl.string(t.iqlsnD),
{sectionDescription: canCurrentUserManageMessageFilters2 ? intl.format(t['4Z9Fbb'],
{setUpAutomod: setUpAutomod_116182}) : value2, inSoundmojiExperiment: inSoundmojiExperiment});
moduleValue17 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
object[6] = moduleValue17.generateChannelAppsSection(channelPermissionSpecMapBinding, intl.string(t['rrh/W6']),
{showActivities: false});
r1 = object;
} else if (ChannelTypes.GUILD_FORUM === type) {
string = intl.string;
r13 = isMediaChannel2 ? Reflect.apply(string, intl, [t.aSjPgw]) : Reflect.apply(string, intl, [t.TS7Cnb]);
r22 = isMediaChannel2 ? t.YjJTtH : t['1MTnqY'];
moduleValue7 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
generateChannelGeneralSection = moduleValue7.generateChannelGeneralSection;
string = intl.string;
object = [Reflect.apply(generateChannelGeneralSection, moduleValue7, [channelPermissionSpecMapBinding,
Reflect.apply(string, intl, [t.ouHggI])])];
moduleValue8 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
generateChannelMembershipSection = moduleValue8.generateChannelMembershipSection;
string = intl.string;
object[1] = Reflect.apply(generateChannelMembershipSection, moduleValue8, [channelPermissionSpecMapBinding,
Reflect.apply(string, intl, [t.Ny49TN])]);
moduleValue9 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
generateChannelTextSection = moduleValue9.generateChannelTextSection;
if (canCurrentUserManageMessageFilters2) {
format = intl.format;
closure = setUpAutomod;
r14 = Reflect.apply(format, intl, [r22, {setUpAutomod: closure}]);
r23 = closure;
} else {
r14 = value2;
r23 = require;
}
object[2] = Reflect.apply(generateChannelTextSection, moduleValue9, [channelPermissionSpecMapBinding, r13,
{'showPrivateThreads': false, 'showCreateThreads': false, sectionDescription: r14,
inSoundmojiExperiment: inSoundmojiExperiment}]);
moduleValue10 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
generateChannelAppsSection = moduleValue10.generateChannelAppsSection;
string = intl.string;
object[3] = Reflect.apply(generateChannelAppsSection, moduleValue10, [channelPermissionSpecMapBinding,
Reflect.apply(string, intl, [t['rrh/W6']])]);
arraySpread(object, conditionalPermissionSpec(r8, _fun116184), 4, r23);
r1 = object;
} else if (ChannelTypes.GUILD_MEDIA === type) {
string = intl.string;
r13 = isMediaChannel2 ? Reflect.apply(string, intl, [t.aSjPgw]) : Reflect.apply(string, intl, [t.TS7Cnb]);
r22 = isMediaChannel2 ? t.YjJTtH : t['1MTnqY'];
moduleValue7 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
generateChannelGeneralSection = moduleValue7.generateChannelGeneralSection;
string = intl.string;
object = [Reflect.apply(generateChannelGeneralSection, moduleValue7, [channelPermissionSpecMapBinding,
Reflect.apply(string, intl, [t.ouHggI])])];
moduleValue8 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
generateChannelMembershipSection = moduleValue8.generateChannelMembershipSection;
string = intl.string;
object[1] = Reflect.apply(generateChannelMembershipSection, moduleValue8, [channelPermissionSpecMapBinding,
Reflect.apply(string, intl, [t.Ny49TN])]);
moduleValue9 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
generateChannelTextSection = moduleValue9.generateChannelTextSection;
if (canCurrentUserManageMessageFilters2) {
format = intl.format;
closure = setUpAutomod;
r14 = Reflect.apply(format, intl, [r22, {setUpAutomod: closure}]);
r23 = closure;
} else {
r14 = value2;
r23 = require;
}
object[2] = Reflect.apply(generateChannelTextSection, moduleValue9, [channelPermissionSpecMapBinding, r13,
{'showPrivateThreads': false, 'showCreateThreads': false, sectionDescription: r14,
inSoundmojiExperiment: inSoundmojiExperiment}]);
moduleValue10 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
generateChannelAppsSection = moduleValue10.generateChannelAppsSection;
string = intl.string;
object[3] = Reflect.apply(generateChannelAppsSection, moduleValue10, [channelPermissionSpecMapBinding,
Reflect.apply(string, intl, [t['rrh/W6']])]);
arraySpread(object, conditionalPermissionSpec(r8, _fun116184), 4, r23);
r1 = object;
} else {
moduleValue3 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
generateChannelGeneralSection = moduleValue3.generateChannelGeneralSection;
string = intl.string;
object = [Reflect.apply(generateChannelGeneralSection, moduleValue3, [channelPermissionSpecMapBinding,
Reflect.apply(string, intl, [t.ouHggI])])];
moduleValue4 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
generateChannelMembershipSection = moduleValue4.generateChannelMembershipSection;
string = intl.string;
object[1] = Reflect.apply(generateChannelMembershipSection, moduleValue4, [channelPermissionSpecMapBinding,
Reflect.apply(string, intl, [t.Ny49TN])]);
moduleValue5 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
object[2] = moduleValue5.generateChannelTextSection(channelPermissionSpecMapBinding, intl.string(t.cKobO5),
{showPrivateThreads: a1.type !== ChannelTypes.GUILD_ANNOUNCEMENT, showCreateThreads: true,
inSoundmojiExperiment: inSoundmojiExperiment});
moduleValue6 = importAll(15196) /* metro dependency 15196: PermissionUtils */;
generateChannelAppsSection = moduleValue6.generateChannelAppsSection;
string = intl.string;
object[3] = Reflect.apply(generateChannelAppsSection, moduleValue6, [channelPermissionSpecMapBinding,
Reflect.apply(string, intl, [t['rrh/W6']])]);
arraySpread(object, conditionalPermissionSpec(r8, _fun116185), 4, r23);
r1 = object;
}
return filterPermissions(r1, set);
}
function generateGuildPermissionSpec(a0) { // fn#116186, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15389:5501, offset: 0x0247ef37, size: 269 bytes, params: 2, frame: 17
var r1;
var add;
var VIEW_GUILD_ANALYTICS;
var defaultImport;
var MANAGE_OFFICIAL_MESSAGES;
const Set = global.Set;
const set = new Set();
let features = a0.features;
let has = features.has;
const COMMUNITY = GuildFeatures.COMMUNITY;
if (!Reflect.apply(has, features, [COMMUNITY])) {
add = set.add;
VIEW_GUILD_ANALYTICS = Permissions.VIEW_GUILD_ANALYTICS;
Reflect.apply(add, set, [VIEW_GUILD_ANALYTICS.toString()]);
}
features = a0.features;
has = features.has;
const VERIFIED = GuildFeatures.VERIFIED;
const value3 = Reflect.apply(has, features, [VERIFIED]);
if (value3) {
defaultImport = importDefault(6859) /* metro dependency 6859: GuildOfficialMessagesExperiment */;
r1 = defaultImport.getCurrentConfig({guildId: a0.id, location: 'generateGuildPermissionSpec'}).enabled;
} else {
r1 = value3;
}
if (!r1) {
add = set.add;
MANAGE_OFFICIAL_MESSAGES = Permissions.MANAGE_OFFICIAL_MESSAGES;
Reflect.apply(add, set, [MANAGE_OFFICIAL_MESSAGES.toString()]);
}
const filterPermissionsBinding = filterPermissions;
const permissionUtilsModule = importAll(15196) /* metro dependency 15196: PermissionUtils */;
return filterPermissionsBinding(permissionUtilsModule.generateGuildPermissionSpec(getPermissionOptions(a0.id)), set);
}
function _fun116177(a0) { // fn#116177, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15389:1170, offset: 0x0247e1a4, size: 51 bytes, params: 2, frame: 13
const object2 = {};
copyDataProperties(object2, a0, undefined);
object2['permissions'] = a0.permissions.filter(function(a0) {
return !require.has(a0.flag.toString());
});
return object2;
}
function _fun116180() { // fn#116180, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15389:2445, offset: 0x0247eddb, size: 97 bytes, params: 1, frame: 18
const permissionUtilsModule = importAll(15196) /* metro dependency 15196: PermissionUtils */;
const generateChannelStageSection = permissionUtilsModule.generateChannelStageSection;
const binding = env0_1;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
return Reflect.apply(generateChannelStageSection, permissionUtilsModule, [binding,
intl.string((require(1244) /* metro dependency 1244: indexNative */).t.yniauk)]);
}
function generateChannelPermissionSpecSetUpAutomod() { // fn#116181, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15389:3062, owner: generateChannelPermissionSpec.setUpAutomod, offset: 0x0247ee3c, size: 56 bytes, params: 1, frame: 14
const defaultImport = importDefault(9112) /* metro dependency 9112: GuildSettingsActionCreators */;
const open = defaultImport.open;
const binding = env0_0;
const GUILD_AUTOMOD = GuildSettingsSections.GUILD_AUTOMOD;
Reflect.apply(open, defaultImport, [binding, GUILD_AUTOMOD]);
}
function generateChannelPermissionSpecSetUpAutomod_116183() { // fn#116183, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15389:4570, owner: generateChannelPermissionSpec.setUpAutomod, offset: 0x0247ee74, size: 98 bytes, params: 1, frame: 14
var value2;
if (!env0_2) {
value2 = environment.__proto__;
(require(7155) /* metro dependency 7155: Tracking */).trackForumEnableAutomodClicked();
}
const defaultImport = importDefault(9112) /* metro dependency 9112: GuildSettingsActionCreators */;
const open = defaultImport.open;
const binding = env0_0;
const GUILD_AUTOMOD = GuildSettingsSections.GUILD_AUTOMOD;
Reflect.apply(open, defaultImport, [binding, GUILD_AUTOMOD]);
}
function _fun116184() { // fn#116184, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15389:4801, offset: 0x0247eed6, size: 97 bytes, params: 1, frame: 18
const permissionUtilsModule = importAll(15196) /* metro dependency 15196: PermissionUtils */;
const generateChannelVoiceSection = permissionUtilsModule.generateChannelVoiceSection;
const binding = env0_1;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
return Reflect.apply(generateChannelVoiceSection, permissionUtilsModule, [binding,
intl.string((require(1244) /* metro dependency 1244: indexNative */).t['46Ra1b'])]);
}
+978
View File
@@ -0,0 +1,978 @@
/* Metro module 3789; source: utils/PermissionUtils.tsx; dependencies: [1937, 3785, 3786, 1383, 1422, 1939, 1226, 1379, 1945, 1938, 1867, 1878, 661, 483, 22, 3790, 3773, 21, 1940, 1909, 2] */
function _fun28801(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#28801, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3916:6, offset: 0x00f82c5e, size: 1232 bytes, params: 8, frame: 75
const env0_0 = require;
const closure = computePermissions;
const closure2 = applyThreadPermissions;
const closure3 = makeEveryoneOverwrite;
const closure4 = function({permission, user, context, overwrites, roles, excludeGuildPermissions}) {
return importAll(dependencyMap[13]).has(computePermissions({user: user, context: context,
overwrites: overwrites,
roles: roles, checkElevated: true, excludeGuildPermissions: excludeGuildPermissions}), permission);
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const impersonateStore = importDefault(1937) /* metro dependency 1937: ImpersonateStore */;
const lurkingStore = importDefault(3785) /* metro dependency 3785: LurkingStore */;
const joinedThreadsStore = importDefault(3786) /* metro dependency 3786: JoinedThreadsStore */;
let value = require(1383) /* metro dependency 1383: ChannelRecord */;
const env0_7 = value.THREAD_CHANNEL_TYPES;
const env0_8 = value.ChannelRecordBase;
value = require(1422) /* metro dependency 1422: GuildRecord */;
const env0_9 = value.getGuildEveryoneRoleId;
const env0_10 = value.isGuildOwner;
const env0_11 = (require(1939) /* metro dependency 1939: GuildRoleRecord */).hasPermission;
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const guildMemberStore = importDefault(1945) /* metro dependency 1945: GuildMemberStore */;
const guildRoleStore = importDefault(1938) /* metro dependency 1938: GuildRoleStore */;
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
value = require(661) /* metro dependency 661: Constants */;
const Permissions = value.Permissions;
const env0_19 = value.ElevatedPermissions;
const env0_20 = value.MFALevels;
const env0_21 = value.ChannelTypes;
const env0_22 = value.EMPTY_STRING_SNOWFLAKE_ID;
value = importAll(483) /* metro dependency 483: BigFlagUtils */;
value = value.deserialize(0);
const bigFlagUtilsModule = importAll(483) /* metro dependency 483: BigFlagUtils */;
let combine = bigFlagUtilsModule.combine;
const value4 = (importDefault(22) /* metro dependency 22 */).values(Permissions);
items = [];
arraySpread(items, value4, 0, undefined);
const value5 = apply(combine, items, bigFlagUtilsModule, undefined);
const value6 = bigFlagUtilsModule;
combine = value6.combine;
const CREATE_INSTANT_INVITE = Permissions.CREATE_INSTANT_INVITE;
let CHANGE_NICKNAME = Permissions.CHANGE_NICKNAME;
let VIEW_CHANNEL = Permissions.VIEW_CHANNEL;
let SEND_MESSAGES = Permissions.SEND_MESSAGES;
let EMBED_LINKS = Permissions.EMBED_LINKS;
let ATTACH_FILES = Permissions.ATTACH_FILES;
let READ_MESSAGE_HISTORY = Permissions.READ_MESSAGE_HISTORY;
const MENTION_EVERYONE = Permissions.MENTION_EVERYONE;
let USE_EXTERNAL_EMOJIS = Permissions.USE_EXTERNAL_EMOJIS;
let USE_EXTERNAL_STICKERS = Permissions.USE_EXTERNAL_STICKERS;
let ADD_REACTIONS = Permissions.ADD_REACTIONS;
const CREATE_PUBLIC_THREADS = Permissions.CREATE_PUBLIC_THREADS;
const CREATE_PRIVATE_THREADS = Permissions.CREATE_PRIVATE_THREADS;
let SEND_MESSAGES_IN_THREADS = Permissions.SEND_MESSAGES_IN_THREADS;
const SEND_POLLS = Permissions.SEND_POLLS;
let CONNECT = Permissions.CONNECT;
let SPEAK = Permissions.SPEAK;
let USE_VAD = Permissions.USE_VAD;
let STREAM = Permissions.STREAM;
let USE_EMBEDDED_ACTIVITIES = Permissions.USE_EMBEDDED_ACTIVITIES;
let USE_SOUNDBOARD = Permissions.USE_SOUNDBOARD;
const REQUEST_TO_SPEAK = Permissions.REQUEST_TO_SPEAK;
const USE_APPLICATION_COMMANDS = Permissions.USE_APPLICATION_COMMANDS;
let CREATE_GUILD_EXPRESSIONS = Permissions.CREATE_GUILD_EXPRESSIONS;
const CREATE_EVENTS = Permissions.CREATE_EVENTS;
let USE_EXTERNAL_APPS = Permissions.USE_EXTERNAL_APPS;
const value7 = Reflect.apply(combine, value6, [CREATE_INSTANT_INVITE, CHANGE_NICKNAME, VIEW_CHANNEL, SEND_MESSAGES,
EMBED_LINKS, ATTACH_FILES, READ_MESSAGE_HISTORY, MENTION_EVERYONE, USE_EXTERNAL_EMOJIS, USE_EXTERNAL_STICKERS,
ADD_REACTIONS, CREATE_PUBLIC_THREADS, CREATE_PRIVATE_THREADS, SEND_MESSAGES_IN_THREADS, SEND_POLLS, CONNECT,
SPEAK, USE_VAD, STREAM, USE_EMBEDDED_ACTIVITIES, USE_SOUNDBOARD, REQUEST_TO_SPEAK, USE_APPLICATION_COMMANDS,
CREATE_GUILD_EXPRESSIONS, CREATE_EVENTS, USE_EXTERNAL_APPS]);
const value8 = bigFlagUtilsModule;
combine = value8.combine;
VIEW_CHANNEL = Permissions.VIEW_CHANNEL;
READ_MESSAGE_HISTORY = Permissions.READ_MESSAGE_HISTORY;
const env0_26 = Reflect.apply(combine, value8, [VIEW_CHANNEL, READ_MESSAGE_HISTORY]);
const value9 = bigFlagUtilsModule;
combine = value9.combine;
VIEW_CHANNEL = Permissions.VIEW_CHANNEL;
SEND_MESSAGES = Permissions.SEND_MESSAGES;
CONNECT = Permissions.CONNECT;
SPEAK = Permissions.SPEAK;
STREAM = Permissions.STREAM;
USE_EMBEDDED_ACTIVITIES = Permissions.USE_EMBEDDED_ACTIVITIES;
USE_EXTERNAL_APPS = Permissions.USE_EXTERNAL_APPS;
USE_EXTERNAL_EMOJIS = Permissions.USE_EXTERNAL_EMOJIS;
const USE_EXTERNAL_SOUNDS = Permissions.USE_EXTERNAL_SOUNDS;
USE_EXTERNAL_STICKERS = Permissions.USE_EXTERNAL_STICKERS;
USE_SOUNDBOARD = Permissions.USE_SOUNDBOARD;
USE_VAD = Permissions.USE_VAD;
SEND_MESSAGES_IN_THREADS = Permissions.SEND_MESSAGES_IN_THREADS;
EMBED_LINKS = Permissions.EMBED_LINKS;
ATTACH_FILES = Permissions.ATTACH_FILES;
ADD_REACTIONS = Permissions.ADD_REACTIONS;
const env0_27 = Reflect.apply(combine, value9, [VIEW_CHANNEL, SEND_MESSAGES, CONNECT, SPEAK, STREAM,
USE_EMBEDDED_ACTIVITIES, USE_EXTERNAL_APPS, USE_EXTERNAL_EMOJIS, USE_EXTERNAL_SOUNDS, USE_EXTERNAL_STICKERS,
USE_SOUNDBOARD, USE_VAD, SEND_MESSAGES_IN_THREADS, EMBED_LINKS, ATTACH_FILES, ADD_REACTIONS]);
const value11 = bigFlagUtilsModule;
combine = value11.combine;
VIEW_CHANNEL = Permissions.VIEW_CHANNEL;
READ_MESSAGE_HISTORY = Permissions.READ_MESSAGE_HISTORY;
const env0_28 = Reflect.apply(combine, value11, [VIEW_CHANNEL, READ_MESSAGE_HISTORY]);
const value12 = bigFlagUtilsModule;
combine = value12.combine;
VIEW_CHANNEL = Permissions.VIEW_CHANNEL;
READ_MESSAGE_HISTORY = Permissions.READ_MESSAGE_HISTORY;
CHANGE_NICKNAME = Permissions.CHANGE_NICKNAME;
const env0_29 = Reflect.apply(combine, value12, [VIEW_CHANNEL, READ_MESSAGE_HISTORY, CHANGE_NICKNAME]);
const value13 = bigFlagUtilsModule;
combine = value13.combine;
const MANAGE_GUILD = Permissions.MANAGE_GUILD;
const MANAGE_ROLES = Permissions.MANAGE_ROLES;
const ADMINISTRATOR = Permissions.ADMINISTRATOR;
const BAN_MEMBERS = Permissions.BAN_MEMBERS;
const MANAGE_NICKNAMES = Permissions.MANAGE_NICKNAMES;
CREATE_GUILD_EXPRESSIONS = Permissions.CREATE_GUILD_EXPRESSIONS;
const MANAGE_GUILD_EXPRESSIONS = Permissions.MANAGE_GUILD_EXPRESSIONS;
const MANAGE_WEBHOOKS = Permissions.MANAGE_WEBHOOKS;
const VIEW_AUDIT_LOG = Permissions.VIEW_AUDIT_LOG;
const VIEW_GUILD_ANALYTICS = Permissions.VIEW_GUILD_ANALYTICS;
const value14 = Reflect.apply(combine, value13, [MANAGE_GUILD, MANAGE_ROLES, ADMINISTRATOR, BAN_MEMBERS,
MANAGE_NICKNAMES, CREATE_GUILD_EXPRESSIONS, MANAGE_GUILD_EXPRESSIONS, MANAGE_WEBHOOKS, VIEW_AUDIT_LOG,
VIEW_GUILD_ANALYTICS]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/PermissionUtils.tsx');
exports.NONE = value;
exports.ALL = value5;
exports.DEFAULT = value7;
exports.VIEW_GUILD_SETTINGS = value14;
exports.computePermissionsForRoles = computePermissionsForRoles;
exports.computePermissions = closure;
exports.applyThreadPermissions = closure2;
exports.areChannelsLocked = areChannelsLocked;
exports.getGuildVisualOwnerId = getGuildVisualOwnerId;
exports.isRoleHigher = isRoleHigher;
exports.getHighestRole = getHighestRole;
exports.getHighestHoistedRole = getHighestHoistedRole;
exports.makeEveryoneOverwrite = closure3;
exports.canManageACategory = canManageACategory;
exports.can = closure4;
exports.ALLOW = 'ALLOW';
exports.DENY = 'DENY';
exports.PASSTHROUGH = 'PASSTHROUGH';
exports.canEveryoneRole = canEveryoneRole;
exports.canEveryone = canEveryone;
}
function calculateElevatedPermissions(a0, a1, a2) { // fn#28802, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3916:1721, offset: 0x00f8312e, size: 154 bytes, params: 4, frame: 17
var r0;
var currentUser;
let value = a0;
const value2 = a3;
let r1 = (!(value2 !== undefined) || value2) && a1.mfaLevel === MFALevels.ELEVATED && a2 === AuthenticationStore.getId();
if (r1) {
currentUser = UserStore.getCurrentUser();
if (currentUser != null && currentUser.mfaEnabled) {
r1 = value;
} else {
value = (importAll(483) /* metro dependency 483: BigFlagUtils */).remove(value, ElevatedPermissions);
r1 = value;
}
r0 = r1;
} else {
r0 = value;
}
return r0;
}
function applyOverwrites(a0, a1, a2, a3) { // fn#28803, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3916:1901, offset: 0x00f831c8, size: 574 bytes, params: 5, frame: 30
var r13;
var r7;
var r9;
var r11;
var r14;
var r15;
var r10;
var r12;
var r4;
var r2;
var r0;
var moduleValue;
var remove;
var deny;
var moduleValue2;
var add;
var allow;
var binding;
var roles;
var length;
var value3;
var moduleValue3;
var value4;
var moduleValue4;
var value5;
var value6;
var value8;
var moduleValue7;
var value9;
var moduleValue8;
var moduleValue9;
var value11;
let value = a2;
let property = a3[a0];
if (property == null) {
r13 = value;
} else {
moduleValue = importAll(483) /* metro dependency 483: BigFlagUtils */;
remove = moduleValue.remove;
deny = property.deny;
value = Reflect.apply(remove, moduleValue, [value, deny]);
moduleValue2 = importAll(483) /* metro dependency 483: BigFlagUtils */;
add = moduleValue2.add;
allow = property.allow;
value = Reflect.apply(add, moduleValue2, [value, allow]);
r13 = value;
}
if (a1 == null) {
r0 = r13;
} else {
binding = env0_23;
roles = a1.roles;
length = roles.length;
value3 = 0;
if (value3 < length) {
r7 = binding;
r9 = binding;
r11 = value3;
while (true) {
roles = a1.roles;
property = a3[roles[r11]];
if (property == null) {
r14 = r7;
r15 = r9;
} else {
moduleValue3 = importAll(483) /* metro dependency 483: BigFlagUtils */;
add = moduleValue3.add;
allow = property.allow;
value4 = Reflect.apply(add, moduleValue3, [r9, allow]);
moduleValue4 = importAll(483) /* metro dependency 483: BigFlagUtils */;
add = moduleValue4.add;
deny = property.deny;
value5 = Reflect.apply(add, moduleValue4, [r7, deny]);
r14 = value5;
r15 = value4;
}
value6 = typeof r11 === 'bigint' ? r11 + 1n : +r11 + 1;
roles = a1.roles;
length = roles.length;
if (value6 < length) {
r7 = r14;
r9 = r15;
r11 = value6;
continue;
}
r10 = r15;
r12 = r14;
break;
}
} else {
r10 = binding;
r12 = binding;
}
value8 = (importAll(483) /* metro dependency 483: BigFlagUtils */).add((importAll(483) /* metro dependency 483: BigFlagUtils */).remove(r13,
r12), r10);
property = a3[a1.userId];
if (property == null) {
r4 = value8;
} else {
moduleValue7 = importAll(483) /* metro dependency 483: BigFlagUtils */;
value9 = moduleValue7.remove(value8, property.deny);
moduleValue8 = importAll(483) /* metro dependency 483: BigFlagUtils */;
r4 = moduleValue8.add(value9, property.allow);
}
moduleValue9 = importAll(483) /* metro dependency 483: BigFlagUtils */;
value11 = moduleValue9.has(r4, Permissions.ADMINISTRATOR);
r2 = (require(3790) /* metro dependency 3790: AutomodPermissionUtils */).hasAutomodQuarantinedProfile(a1) && !value11;
r4 = r2 ? (importAll(483) /* metro dependency 483: BigFlagUtils */).filter(r4, env0_29) : r4;
r2 = (require(3773) /* metro dependency 3773: CommunicationDisabledUtils */).isMemberCommunicationDisabled(a1) && !value11;
r0 = r2 ? (importAll(483) /* metro dependency 483: BigFlagUtils */).filter(r4, env0_28) : r4;
}
return r0;
}
function computePermissionsForMember({userId, member, guild, overwrites, roles, checkElevated, excludeGuildPermissions, lurkerPermissionsMask}) { // fn#28804, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3916:2474, offset: 0x00f83406, size: 565 bytes, params: 2, frame: 29
var r14;
var r15;
var r10;
var r13;
var r9;
var object2;
var permissions;
var length;
var value2;
var moduleValue;
var add;
var value3;
var value4;
checkElevated = checkElevated === undefined || checkElevated;
excludeGuildPermissions = !(excludeGuildPermissions === undefined) && excludeGuildPermissions;
const r12 = lurkerPermissionsMask !== undefined ? lurkerPermissionsMask : env0_26;
if (excludeGuildPermissions) {
return applyOverwrites(guild.id, member, env0_23, overwrites);
}
if (roles != null) {
object2 = {};
copyDataProperties(object2, GuildRoleStore.getUnsafeMutableRoles(guild.id), undefined);
copyDataProperties(object2, roles, undefined);
r14 = object2;
} else {
r14 = GuildRoleStore.getUnsafeMutableRoles(guild.id);
}
let property = r14[getGuildEveryoneRoleId(guild)];
if (property != null) {
permissions = property.permissions;
r15 = permissions;
} else {
r15 = env0_25;
}
if (member == null) {
r9 = r15;
} else {
roles = member.roles;
length = roles.length;
value2 = 0;
if (value2 < length) {
r10 = r15;
r13 = value2;
while (true) {
roles = member.roles;
property = r14[roles[r13]];
if (property === undefined) {
r15 = r10;
} else {
moduleValue = importAll(483) /* metro dependency 483: BigFlagUtils */;
add = moduleValue.add;
permissions = property.permissions;
value3 = Reflect.apply(add, moduleValue, [r10, permissions]);
r15 = value3;
}
value4 = typeof r13 === 'bigint' ? r13 + 1n : +r13 + 1;
roles = member.roles;
length = roles.length;
if (value4 < length) {
r10 = r15;
r13 = value4;
continue;
}
r9 = r15;
break;
}
} else {
r9 = r15;
}
}
const bigFlagUtilsModule = importAll(483) /* metro dependency 483: BigFlagUtils */;
const has = bigFlagUtilsModule.has;
const ADMINISTRATOR = Permissions.ADMINISTRATOR;
r9 = Reflect.apply(has, bigFlagUtilsModule, [r9, ADMINISTRATOR]) ? env0_24 : applyOverwrites(guild.id, member, r9,
overwrites);
const r11 = LurkingStore.isLurking(guild.id) || member != null && member.isPending ? bigFlagUtilsModule.filter(r9,
r12) : r9;
return calculateElevatedPermissions(GuildMemberStore.isCurrentUserGuest(guild.id) ? bigFlagUtilsModule.filter(r11,
env0_27) : r11, guild, userId, checkElevated);
}
function computePermissions({user, context, overwrites, roles, checkElevated, excludeGuildPermissions}) { // fn#28805, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3916:3140, offset: 0x00f8363b, size: 630 bytes, params: 2, frame: 30
var r14;
var r3;
var r11;
var r4;
var r13;
var r15;
var object2;
var guildId;
var currentUser;
var value9;
var currentUser2;
let value = undefined;
checkElevated = checkElevated === value || checkElevated;
excludeGuildPermissions = !(excludeGuildPermissions === value) && excludeGuildPermissions;
if (user == null) {
value = environment;
return env0_23;
}
const r2 = typeof user === 'string' ? user : user.id;
const binding = env0_26;
if (context instanceof ChannelRecordBase) {
if (context.isScheduledForDeletion()) {
return env0_23;
}
if (THREAD_CHANNEL_TYPES.has(context.type)) {
value9 = ChannelStore.getChannel(context.parent_id);
if (value9 == null) {
return env0_23;
}
if (value9.isScheduledForDeletion()) {
return env0_23;
}
currentUser2 = UserStore.getCurrentUser();
return applyThreadPermissions(context, computePermissions({user: user, context: value9,
overwrites: overwrites,
roles: roles, checkElevated: checkElevated, excludeGuildPermissions: excludeGuildPermissions}),
r2 === (currentUser2 == null ? value : currentUser2.id) && JoinedThreadsStore.hasJoined(context.id),
GuildMemberStore.isCurrentUserGuest(context.guild_id));
}
r3 = context.computeLurkerPermissionsAllowList() ?? binding;
if (overwrites != null) {
object2 = {};
copyDataProperties(object2, context.permissionOverwrites, undefined);
copyDataProperties(object2, overwrites, undefined);
r11 = object2;
} else {
r11 = context.permissionOverwrites;
}
guildId = context.getGuildId();
r4 = guildId != null ? GuildStore.getGuild(guildId) : null;
r13 = r3;
r14 = r11;
r15 = r4;
} else {
r14 = overwrites ?? ({});
r13 = binding;
r15 = context;
}
if (r15 == null) {
r3 = env0_23;
} else {
currentUser = UserStore.getCurrentUser();
r3 = r2 !== (currentUser == null ? value : currentUser.id) ? isGuildOwner(r15,
r2) ? calculateElevatedPermissions(env0_24, r15, r2,
checkElevated) : computePermissionsForMember({userId: r2,
member: GuildMemberStore.getMember(r15.id, r2), guild: r15, overwrites: r14, roles: roles,
checkElevated: checkElevated, excludeGuildPermissions: excludeGuildPermissions,
lurkerPermissionsMask: r13}) : ImpersonateStore.isViewingRoles(r15.id) ? computePermissionsForMember({userId: r2,
member: GuildMemberStore.getMember(r15.id, r2), guild: r15, overwrites: r14, roles: roles,
checkElevated: checkElevated, excludeGuildPermissions: excludeGuildPermissions,
lurkerPermissionsMask: r13}) : isGuildOwner(r15, r2) ? calculateElevatedPermissions(env0_24, r15, r2,
checkElevated) : computePermissionsForMember({userId: r2, member: GuildMemberStore.getMember(r15.id, r2),
guild: r15, overwrites: r14, roles: roles, checkElevated: checkElevated,
excludeGuildPermissions: excludeGuildPermissions, lurkerPermissionsMask: r13});
}
return r3;
}
function applyThreadPermissions(a0, a1, a2, a3) { // fn#28806, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3916:4218, offset: 0x00f838b1, size: 405 bytes, params: 5, frame: 18
var r3;
var r2;
var r0;
var moduleValue;
var moduleValue2;
var moduleValue3;
var moduleValue4;
var moduleValue5;
var moduleValue6;
var moduleValue7;
const type = a0.type;
const MEDIA_THREAD = ChannelTypes.MEDIA_THREAD;
if (type === MEDIA_THREAD) {
moduleValue7 = importAll(483) /* metro dependency 483: BigFlagUtils */;
r0 = moduleValue7.combine(Permissions.READ_MESSAGE_HISTORY, Permissions.VIEW_CHANNEL);
} else if (a0.type !== ChannelTypes.PRIVATE_THREAD) {
moduleValue2 = importAll(483) /* metro dependency 483: BigFlagUtils */;
if (moduleValue2.has(a1, Permissions.SEND_MESSAGES_IN_THREADS)) {
if (a0.isLockedThread()) {
moduleValue4 = importAll(483) /* metro dependency 483: BigFlagUtils */;
if (moduleValue4.has(a1, Permissions.MANAGE_THREADS)) {
moduleValue6 = importAll(483) /* metro dependency 483: BigFlagUtils */;
r3 = moduleValue6.combine(a1, Permissions.SEND_MESSAGES);
} else {
moduleValue5 = importAll(483) /* metro dependency 483: BigFlagUtils */;
r3 = moduleValue5.remove(a1, Permissions.SEND_MESSAGES);
}
} else {
moduleValue6 = importAll(483) /* metro dependency 483: BigFlagUtils */;
r3 = moduleValue6.combine(a1, Permissions.SEND_MESSAGES);
}
r2 = r3;
} else {
moduleValue3 = importAll(483) /* metro dependency 483: BigFlagUtils */;
r2 = moduleValue3.remove(a1, Permissions.SEND_MESSAGES);
}
r0 = r2;
} else if (a2) {
moduleValue2 = importAll(483) /* metro dependency 483: BigFlagUtils */;
if (moduleValue2.has(a1, Permissions.SEND_MESSAGES_IN_THREADS)) {
if (a0.isLockedThread()) {
moduleValue4 = importAll(483) /* metro dependency 483: BigFlagUtils */;
if (moduleValue4.has(a1, Permissions.MANAGE_THREADS)) {
moduleValue6 = importAll(483) /* metro dependency 483: BigFlagUtils */;
r3 = moduleValue6.combine(a1, Permissions.SEND_MESSAGES);
} else {
moduleValue5 = importAll(483) /* metro dependency 483: BigFlagUtils */;
r3 = moduleValue5.remove(a1, Permissions.SEND_MESSAGES);
}
} else {
moduleValue6 = importAll(483) /* metro dependency 483: BigFlagUtils */;
r3 = moduleValue6.combine(a1, Permissions.SEND_MESSAGES);
}
r2 = r3;
} else {
moduleValue3 = importAll(483) /* metro dependency 483: BigFlagUtils */;
r2 = moduleValue3.remove(a1, Permissions.SEND_MESSAGES);
}
r0 = r2;
} else if (a3) {
moduleValue2 = importAll(483) /* metro dependency 483: BigFlagUtils */;
if (moduleValue2.has(a1, Permissions.SEND_MESSAGES_IN_THREADS)) {
if (a0.isLockedThread()) {
moduleValue4 = importAll(483) /* metro dependency 483: BigFlagUtils */;
if (moduleValue4.has(a1, Permissions.MANAGE_THREADS)) {
moduleValue6 = importAll(483) /* metro dependency 483: BigFlagUtils */;
r3 = moduleValue6.combine(a1, Permissions.SEND_MESSAGES);
} else {
moduleValue5 = importAll(483) /* metro dependency 483: BigFlagUtils */;
r3 = moduleValue5.remove(a1, Permissions.SEND_MESSAGES);
}
} else {
moduleValue6 = importAll(483) /* metro dependency 483: BigFlagUtils */;
r3 = moduleValue6.combine(a1, Permissions.SEND_MESSAGES);
}
r2 = r3;
} else {
moduleValue3 = importAll(483) /* metro dependency 483: BigFlagUtils */;
r2 = moduleValue3.remove(a1, Permissions.SEND_MESSAGES);
}
r0 = r2;
} else {
moduleValue = importAll(483) /* metro dependency 483: BigFlagUtils */;
if (moduleValue.has(a1, Permissions.MANAGE_THREADS)) {
moduleValue2 = importAll(483) /* metro dependency 483: BigFlagUtils */;
if (moduleValue2.has(a1, Permissions.SEND_MESSAGES_IN_THREADS)) {
if (a0.isLockedThread()) {
moduleValue4 = importAll(483) /* metro dependency 483: BigFlagUtils */;
if (moduleValue4.has(a1, Permissions.MANAGE_THREADS)) {
moduleValue6 = importAll(483) /* metro dependency 483: BigFlagUtils */;
r3 = moduleValue6.combine(a1, Permissions.SEND_MESSAGES);
} else {
moduleValue5 = importAll(483) /* metro dependency 483: BigFlagUtils */;
r3 = moduleValue5.remove(a1, Permissions.SEND_MESSAGES);
}
} else {
moduleValue6 = importAll(483) /* metro dependency 483: BigFlagUtils */;
r3 = moduleValue6.combine(a1, Permissions.SEND_MESSAGES);
}
r2 = r3;
} else {
moduleValue3 = importAll(483) /* metro dependency 483: BigFlagUtils */;
r2 = moduleValue3.remove(a1, Permissions.SEND_MESSAGES);
}
r0 = r2;
} else {
r0 = env0_23;
}
}
return r0;
}
function makeEveryoneOverwrite(a0) { // fn#28807, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3916:4624, offset: 0x00f83a46, size: 70 bytes, params: 2, frame: 13
const PermissionOverwriteType = (require(1909) /* metro dependency 1909: Server */).PermissionOverwriteType;
const ROLE = PermissionOverwriteType.ROLE;
return {id: a0, type: ROLE, allow: env0_23, deny: env0_23};
}
function computePermissionsForRoles({forceRoles, context, overwrites, roles, checkElevated, excludeGuildPermissions}) { // fn#28809, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3916:5091, offset: 0x00f83b00, size: 511 bytes, params: 2, frame: 28
var r10;
var r1;
var r13;
var r2;
var r3;
var r12;
var value;
var object2;
var lurkerPermissionsAllowList;
var value2;
var guildId;
var value7;
var applyThreadPermissionsBinding;
checkElevated = checkElevated === undefined || checkElevated;
const binding = env0_26;
if (context instanceof ChannelRecordBase) {
if (context.isScheduledForDeletion()) {
return env0_23;
}
if (THREAD_CHANNEL_TYPES.has(context.type)) {
value7 = ChannelStore.getChannel(context.parent_id);
if (value7 == null) {
r1 = env0_23;
} else {
applyThreadPermissionsBinding = applyThreadPermissions;
value = computePermissionsForRoles({forceRoles: forceRoles, context: value7, overwrites: overwrites,
roles: roles,
checkElevated: checkElevated, excludeGuildPermissions: excludeGuildPermissions});
value = applyThreadPermissionsBinding(context, value, false, false);
r1 = value;
}
return r1;
}
lurkerPermissionsAllowList = context.computeLurkerPermissionsAllowList();
value2 = null;
r1 = value2 == lurkerPermissionsAllowList ? binding : lurkerPermissionsAllowList;
if (value2 != overwrites) {
object2 = {};
copyDataProperties(object2, context.permissionOverwrites, undefined);
copyDataProperties(object2, overwrites, undefined);
r13 = object2;
} else {
r13 = context.permissionOverwrites;
}
guildId = context.getGuildId();
r2 = value2 != guildId ? GuildStore.getGuild(guildId) : value2;
r3 = r1;
r10 = r13;
r12 = r2;
} else {
r10 = overwrites ?? ({});
r3 = binding;
r12 = context;
}
if (r12 == null) {
return env0_23;
}
object2 = {'userId': null, 'nick': '', 'guildId': null, 'guildMemberAvatar': null, 'roles': null,
'colorString': null, 'colorStrings': null, 'hoistRoleId': null, 'premiumSince': null, 'isPending': false};
object2.userId = EMPTY_STRING_SNOWFLAKE_ID;
object2.guildId = r12.id;
object2.roles = (importDefault(21) /* metro dependency 21: SnowflakeUtils */).keys(forceRoles);
const Date = global.Date;
const value5 = Object.create(Date.prototype, {constructor: {value: Date}});
const date = new Date();
object2.joinedAt = (date instanceof Object ? date : value5).toISOString();
object2.communicationDisabledUntil = null;
return computePermissionsForMember({userId: EMPTY_STRING_SNOWFLAKE_ID, member: object2, guild: r12, overwrites: r10,
roles: roles, checkElevated: checkElevated, excludeGuildPermissions: excludeGuildPermissions,
lurkerPermissionsMask: r3});
}
function areChannelsLocked({type, guild_id, permissionOverwrites}, a1) { // fn#28810, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3916:6216, offset: 0x00f83cff, size: 249 bytes, params: 3, frame: 17
var r0;
if (THREAD_CHANNEL_TYPES.has(type)) {
return true;
}
if (a1 == null) {
return false;
}
if (guild_id == null) {
return false;
}
if (guild_id !== a1.guild_id) {
return false;
}
const object3 = {};
copyDataProperties(object3, permissionOverwrites, undefined);
const object4 = {};
copyDataProperties(object4, a1.permissionOverwrites, undefined);
if (object3[guild_id] == null) {
object3[guild_id] = makeEveryoneOverwrite(guild_id);
}
if (object4[guild_id] == null) {
object4[guild_id] = makeEveryoneOverwrite(guild_id);
}
let Object = global.Object;
const length = Object.keys(object3).length;
Object = global.Object;
let value = length === Object.keys(object4).length;
if (value) {
value = global.Object.keys(object3);
value = !value.some(_fun28811);
r0 = value;
} else {
r0 = value;
}
return r0;
}
function getGuildVisualOwnerId(a0) { // fn#28812, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3916:6699, offset: 0x00f83e84, size: 97 bytes, params: 2, frame: 16
const value2 = undefined;
const defaultImport = importDefault(22) /* metro dependency 22 */;
const some = defaultImport.some;
const getUnsafeMutableRoles = GuildRoleStore.getUnsafeMutableRoles;
return Reflect.apply(some, defaultImport, [Reflect.apply(getUnsafeMutableRoles, GuildRoleStore, [a0.id]),
_fun28813]) ? value2 : a0.ownerId ?? value2;
}
function isRoleHigher(a0, a1, a2, a3) { // fn#28814, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3916:6879, offset: 0x00f83f0c, size: 104 bytes, params: 5, frame: 17
var r1;
var r2;
var r0;
value = !(a1 == null || !isGuildOwner(a0, a1));
if (r1) {
value = a2 != null;
if (value) {
value = a3 == null;
if (value) {
r2 = value;
} else {
value = require(1940) /* metro dependency 1940: GuildRoleUtils */;
value = value.doesRoleSortHigher(a2, a3);
r2 = value;
}
r1 = r2;
} else {
r1 = value;
}
r0 = r1;
} else {
r0 = value;
}
return r0;
}
function getHighestRole(a0, a1) { // fn#28815, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3916:7008, offset: 0x00f83f74, size: 84 bytes, params: 3, frame: 16
const getMember = GuildMemberStore.getMember;
if (Reflect.apply(getMember, GuildMemberStore, [a0.id, a1]) != null) {
return GuildRoleStore.getSortedRoles(a0.id).find(_fun28816);
}
}
function getHighestHoistedRole(a0, a1) { // fn#28817, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3916:7163, offset: 0x00f83fe9, size: 53 bytes, params: 3, frame: 14
const hoistRoleId = a1.hoistRoleId;
const value = null;
return value == hoistRoleId ? value : GuildRoleStore.getRole(a0.id, a1.hoistRoleId);
}
function canManageACategory(a0, a1, a2) { // fn#28818, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3916:7329, offset: 0x00f8401e, size: 81 bytes, params: 4, frame: 14
const env0_0 = a0;
const canBinding = can;
const MANAGE_CHANNELS = Permissions.MANAGE_CHANNELS;
const canBinding2 = canBinding({permission: MANAGE_CHANNELS, user: a0, context: a1});
return canBinding2 ? !!canBinding2 : a2.some(_fun28819);
}
function canEveryoneRole(a0, a1) { // fn#28820, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3916:7606, offset: 0x00f840b7, size: 309 bytes, params: 3, frame: 20
var r5;
var r4;
var r1;
var r3;
var type;
var has;
var permissionOverwrites;
var value3;
var permissions;
var property;
var moduleValue;
let value = a1;
if (value instanceof ChannelRecordBase) {
type = value.type;
if (type === ChannelTypes.PRIVATE_THREAD) {
return false;
}
has = THREAD_CHANNEL_TYPES.has;
type = value.type;
if (Reflect.apply(has, THREAD_CHANNEL_TYPES, [type])) {
value = ChannelStore.getChannel(value.parent_id);
if (value == null) {
return false;
}
r5 = value;
permissionOverwrites = r5.permissionOverwrites;
value = r5.getGuildId();
value3 = null;
if (value3 != value) {
value = GuildStore.getGuild(value);
r4 = value;
} else {
r4 = value3;
}
r1 = r4;
r3 = permissionOverwrites;
if (r1 == null) {
return false;
}
permissions = GuildRoleStore.getEveryoneRole(r1).permissions;
property = r3[r1.id];
if (property == null) {
r3 = permissions;
} else {
value = importAll(483) /* metro dependency 483: BigFlagUtils */;
value = value.remove(permissions, property.deny);
moduleValue = importAll(483) /* metro dependency 483: BigFlagUtils */;
value = moduleValue.add(value, property.allow);
r3 = value;
}
value = importAll(483) /* metro dependency 483: BigFlagUtils */;
return value.has(r3, a0);
}
r5 = value;
permissionOverwrites = r5.permissionOverwrites;
value = r5.getGuildId();
value3 = null;
if (value3 != value) {
value = GuildStore.getGuild(value);
r4 = value;
} else {
r4 = value3;
}
r1 = r4;
r3 = permissionOverwrites;
if (r1 == null) {
return false;
}
permissions = GuildRoleStore.getEveryoneRole(r1).permissions;
property = r3[r1.id];
if (property == null) {
r3 = permissions;
} else {
value = importAll(483) /* metro dependency 483: BigFlagUtils */;
value = value.remove(permissions, property.deny);
moduleValue = importAll(483) /* metro dependency 483: BigFlagUtils */;
value = moduleValue.add(value, property.allow);
r3 = value;
}
value = importAll(483) /* metro dependency 483: BigFlagUtils */;
return value.has(r3, a0);
}
r1 = value;
if (r1 == null) {
return false;
}
const getEveryoneRole = GuildRoleStore.getEveryoneRole;
permissions = Reflect.apply(getEveryoneRole, GuildRoleStore, [r1]).permissions;
property = ({})[r1.id];
if (property == null) {
r3 = permissions;
} else {
value = importAll(483) /* metro dependency 483: BigFlagUtils */;
value = value.remove(permissions, property.deny);
moduleValue = importAll(483) /* metro dependency 483: BigFlagUtils */;
value = moduleValue.add(value, property.allow);
r3 = value;
}
return (importAll(483) /* metro dependency 483: BigFlagUtils */).has(r3, a0);
}
function canEveryone(a0, a1) { // fn#28821, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3916:8028, offset: 0x00f841ec, size: 252 bytes, params: 3, frame: 19
var r7;
var r3;
var r4;
var r5;
var r0;
var type;
var has;
var permissionOverwrites;
var value3;
let value = a1;
const env0_0 = a0;
if (value instanceof ChannelRecordBase) {
type = value.type;
if (type === ChannelTypes.PRIVATE_THREAD) {
return false;
}
has = THREAD_CHANNEL_TYPES.has;
type = value.type;
if (Reflect.apply(has, THREAD_CHANNEL_TYPES, [type])) {
value = ChannelStore.getChannel(value.parent_id);
if (value == null) {
return false;
}
r7 = value;
permissionOverwrites = r7.permissionOverwrites;
value = r7.getGuildId();
value3 = null;
if (value3 != value) {
value = GuildStore.getGuild(value);
r3 = value;
} else {
r3 = value3;
}
r4 = permissionOverwrites;
r5 = r3;
if (r5 == null) {
return false;
}
value = GuildRoleStore.getEveryoneRole(r5);
value = hasPermission(value, a0);
if (value) {
value = importDefault(22) /* metro dependency 22 */;
value = !value.some(r4, _fun28822);
r0 = value;
} else {
r0 = !!value;
}
return r0;
}
r7 = value;
permissionOverwrites = r7.permissionOverwrites;
value = r7.getGuildId();
value3 = null;
if (value3 != value) {
value = GuildStore.getGuild(value);
r3 = value;
} else {
r3 = value3;
}
r4 = permissionOverwrites;
r5 = r3;
} else {
r4 = {};
r5 = value;
}
if (r5 == null) {
return false;
}
value = GuildRoleStore.getEveryoneRole(r5);
value = hasPermission(value, a0);
if (value) {
value = importDefault(22) /* metro dependency 22 */;
value = !value.some(r4, _fun28822);
r0 = value;
} else {
r0 = !!value;
}
return r0;
}
function _fun28811(a0) { // fn#28811, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3916:6564, offset: 0x00f83df8, size: 140 bytes, params: 2, frame: 16
var r0;
const property = env0_0[a0];
const property2 = env0_1[a0];
let value = property2 == null;
if (value) {
r0 = value;
} else {
value = environment.__proto__;
value = importAll(483) /* metro dependency 483: BigFlagUtils */;
value = !value.equals(property2.deny, property.deny);
r0 = value;
}
if (!r0) {
value = environment.__proto__;
value = importAll(483) /* metro dependency 483: BigFlagUtils */;
value = !value.equals(property2.allow, property.allow);
r0 = value;
}
return r0;
}
function _fun28813(a0) { // fn#28813, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3916:6792, offset: 0x00f83ee5, size: 39 bytes, params: 2, frame: 14
var r0;
var value;
const hoist = a0.hoist;
if (hoist) {
value = environment.__proto__;
value = hasPermission(a0, Permissions.ADMINISTRATOR);
r0 = value;
} else {
r0 = hoist;
}
return r0;
}
function _fun28816({id}) { // fn#28816, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3916:7110, offset: 0x00f83fc8, size: 33 bytes, params: 2, frame: 11
return env0_0.roles.includes(id);
}
function _fun28819({channel}) { // fn#28819, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3916:7434, offset: 0x00f8406f, size: 72 bytes, params: 2, frame: 13
var r0;
let value = channel.id !== 'null';
if (value) {
value = environment.__proto__;
value = can({permission: Permissions.MANAGE_CHANNELS, user: env0_0, context: channel});
r0 = value;
} else {
r0 = value;
}
return r0;
}
function _fun28822({deny}) { // fn#28822, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3916:8351, offset: 0x00f842e8, size: 54 bytes, params: 2, frame: 13
const value = environment.__proto__;
return (importAll(483) /* metro dependency 483: BigFlagUtils */).has(deny, env0_0);
}
+11
View File
@@ -0,0 +1,11 @@
/* Metro module 477; source: utils/PlatformUtils.tsx; dependencies: [2, 478] */
function _fun6164(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#6164, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:518:6, offset: 0x00cef3cb, size: 123 bytes, params: 8, frame: 22
var propertyName;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/PlatformUtils.tsx');
for (propertyName in require(478) /* metro dependency 478: PlatformUtils */) {
exports[propertyName] = (require(478) /* metro dependency 478: PlatformUtils */)[propertyName];
}
}
+44
View File
@@ -0,0 +1,44 @@
/* Metro module 7937; source: utils/PremiumFeatureUtils.tsx; dependencies: [1879, 661, 1880, 1900, 2] */
function _fun63349(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#63349, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8115:6, offset: 0x01b7ba7b, size: 189 bytes, params: 8, frame: 19
var object2;
const env0_0 = require;
const closure = getUserMaxFileSize;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const overridePremiumTypeStore = importDefault(1879) /* metro dependency 1879: OverridePremiumTypeStore */;
let value = require(661) /* metro dependency 661: Constants */;
const env0_3 = value.MAX_ATTACHMENT_SIZE;
const env0_4 = value.MAX_STAFF_ATTACHMENT_SIZE;
value = require(1880) /* metro dependency 1880: PremiumConstants */;
const env0_5 = value.PremiumUserLimits;
const env0_6 = value.UNSELECTED_PREMIUM_TYPE_OVERRIDE;
object2 = {getUserMaxFileSize: closure};
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/PremiumFeatureUtils.tsx');
exports.default = object2;
exports.getUserMaxFileSize = closure;
}
function getUserMaxFileSize(a0) { // fn#63350, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8115:239, offset: 0x01b7bb38, size: 136 bytes, params: 2, frame: 13
var r0;
var moduleValue;
if (a0 == null) {
return MAX_ATTACHMENT_SIZE;
}
if (a0.isStaff()) {
if (OverridePremiumTypeStore.getPremiumTypeOverride() === UNSELECTED_PREMIUM_TYPE_OVERRIDE) {
r0 = MAX_STAFF_ATTACHMENT_SIZE;
} else if (a0.premiumType == null) {
r0 = MAX_ATTACHMENT_SIZE;
} else {
moduleValue = require(1900) /* metro dependency 1900: PremiumTypeUtils */;
r0 = moduleValue.isPremium(a0) ? PremiumUserLimits[a0.premiumType].fileSize : MAX_ATTACHMENT_SIZE;
}
} else if (a0.premiumType == null) {
r0 = MAX_ATTACHMENT_SIZE;
} else {
moduleValue = require(1900) /* metro dependency 1900: PremiumTypeUtils */;
r0 = moduleValue.isPremium(a0) ? PremiumUserLimits[a0.premiumType].fileSize : MAX_ATTACHMENT_SIZE;
}
return r0;
}
+32
View File
@@ -0,0 +1,32 @@
/* Metro module 1900; source: utils/PremiumTypeUtils.tsx; dependencies: [1880, 2] */
function _fun20850(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#20850, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2027:6, offset: 0x00edda80, size: 167 bytes, params: 8, frame: 21
var object2;
const closure = isPremiumAtLeast;
const closure2 = isPremium;
const closure3 = function(a0, a1) {
return a0 != null && a0.premiumType === a1;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = (require(1880) /* metro dependency 1880: PremiumConstants */).PremiumTypeOrder;
object2 = {isPremiumAtLeast: closure, isPremium: closure2, isPremiumExactly: closure3};
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/PremiumTypeUtils.tsx');
exports.default = object2;
exports.isPremiumAtLeast = closure;
exports.isPremiumAtMost = isPremiumAtMost;
exports.isPremium = closure2;
exports.isPremiumExactly = closure3;
}
function isPremiumAtLeast(a0, a1) { // fn#20851, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2027:123, offset: 0x00eddb27, size: 50 bytes, params: 3, frame: 6
return a1 == null || a0 != null && PremiumTypeOrder[a0] >= PremiumTypeOrder[a1];
}
function isPremium(a0, a1) { // fn#20852, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2027:190, offset: 0x00eddb59, size: 51 bytes, params: 3, frame: 14
return a0 != null && a0.premiumType != null && isPremiumAtLeast(a0.premiumType, a1);
}
function isPremiumAtMost(a0, a1) { // fn#20854, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2027:572, offset: 0x00eddba7, size: 40 bytes, params: 3, frame: 4
return a0 == null || PremiumTypeOrder[a0] <= PremiumTypeOrder[a1];
}
File diff suppressed because it is too large. Load diff
+156
View File
@@ -0,0 +1,156 @@
/* Metro module 5137; source: utils/PriceUtils.tsx; dependencies: [1949, 3804, 1880, 482, 477, 5138, 5140, 5142, 1244, 3802, 2] */
function _fun45261(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#45261, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5315:6, offset: 0x01185e28, size: 304 bytes, params: 8, frame: 25
const env0_0 = require;
const closure = formatSingleCurrencyPrice;
const closure2 = formatDualPriceForBG;
const closure3 = formatPrice;
const closure4 = formatRate;
const closure5 = function(a0) {
var r0;
var value = a0;
if (value.length > 5) {
value = value.replace(RegExp('\\.00(?=[\\s)]|$)', 'g'), '');
r0 = value;
} else {
r0 = value;
}
return r0;
};
let Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const localeStore = importDefault(1949) /* metro dependency 1949: LocaleStore */;
const billingInfoStore = importDefault(3804) /* metro dependency 3804: BillingInfoStore */;
const env0_4 = (require(1880) /* metro dependency 1880: PremiumConstants */).SubscriptionIntervalTypes;
const env0_5 = (require(482) /* metro dependency 482: Constants */).CurrencyCodes;
Object = global.Object;
const env0_6 = Object.freeze(['en-CA', 'en-AU', 'en-NZ']);
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/PriceUtils.tsx');
exports.formatSingleCurrencyPrice = closure;
exports.formatDualPriceForBG = closure2;
exports.formatPrice = closure3;
exports.formatRate = closure4;
exports.formatPercent = function(a0, a1) {
var Intl = global.Intl;
return Intl.NumberFormat(a0, {'style': 'percent', 'minimumFractionDigits': 0}).format(a1);
};
exports.formatSubscriptionPlanRate = formatSubscriptionPlanRate;
exports.maybeShortenPrice = closure5;
exports.shortenAndFormatPrice = function(a0, a1, a2) {
return maybeShortenPrice(formatPrice(a0, a1, a2));
};
}
function formatSingleCurrencyPrice(a0, a1, a2) { // fn#45262, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5315:219, offset: 0x01185f58, size: 273 bytes, params: 4, frame: 20
var r0;
let value = a2;
const object2 = {};
copyDataProperties(object2, value ?? ({}), undefined);
const r4 = value?.localeOverride ?? LocaleStore.locale;
if (r4 === 'en-US' && env0_6.includes(LocaleStore.systemLocale)) {
object2.currencyDisplay = 'code';
}
if (value) {
value = require(477) /* metro dependency 477: PlatformUtils */;
value = value.isWindows();
r0 = value;
} else {
r0 = value;
}
r0 = r0 && LocaleStore.systemLocale === 'en-GB';
if (r0) {
object2.currencyDisplay = 'code';
}
if (object2.maximumFractionDigits === 0 && object2.minimumFractionDigits == null) {
object2.minimumFractionDigits = 0;
}
return (require(5138) /* metro dependency 5138: PriceUtils */).formatPrice(a0, a1, r4, object2);
}
function formatDualPriceForBG(a0, a1) { // fn#45263, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5315:633, offset: 0x01186069, size: 101 bytes, params: 3, frame: 18
const formatSingleCurrencyPriceBinding = formatSingleCurrencyPrice;
const EUR = CurrencyCodes.EUR;
const value2 = formatSingleCurrencyPriceBinding(a0, EUR, a1);
const value3 = 1.95583 * a0;
const BGN = CurrencyCodes.BGN;
return '' + value2 + ' (' + formatSingleCurrencyPriceBinding(value3, BGN, a1) + ')';
}
function formatPrice(a0, a1, a2) { // fn#45264, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5315:766, offset: 0x011860ce, size: 321 bytes, params: 4, frame: 20
var r7;
var r0;
var value5;
var platformName;
var storeFront;
let Date = global.Date;
let value = Date.now();
Date = global.Date;
const date = new Date('2026-08-05T22:00:00Z');
const getTime = date.getTime;
value = value >= Reflect.apply(getTime, date, []);
if (value) {
r0 = false;
} else {
value5 = undefined;
platformName = (require(477) /* metro dependency 477: PlatformUtils */).getPlatformName();
if (platformName === 'android') {
r7 = (require(5140) /* metro dependency 5140: IAPStoreAndroid */).default.getUserCountry();
} else if (platformName === 'ios') {
storeFront = (require(5142) /* metro dependency 5142: GenericIAPStore */).default.getStoreFront();
r7 = storeFront == null ? value5 : storeFront.country;
} else {
r7 = BillingInfoStore.ipCountryCode;
}
r0 = r7 === 'BG' && (a1 == null ? value5 : a1.toLowerCase()) === CurrencyCodes.EUR;
}
r0 = r0 ? formatDualPriceForBG(a0, a2) : formatSingleCurrencyPrice(a0, a1, a2);
return r0;
}
function formatRate(a0, a1, a2) { // fn#45265, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5315:1231, offset: 0x0118620f, size: 342 bytes, params: 4, frame: 19
var Error;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var value;
const YEAR = SubscriptionIntervalTypes.YEAR;
if (a1 === YEAR) {
return intl.formatToPlainString(t['rS8FA+'], {price: a0});
}
let MONTH = SubscriptionIntervalTypes.MONTH;
if (a1 !== MONTH) {
if (a1 !== SubscriptionIntervalTypes.MONTH) {
Error = global.Error;
value = 'Unsupported interval type: ' + a1 + ', and interval count: ' + a2;
throw new Error();
}
if (a2 > 1) {
return intl.formatToPlainString(t['Qc+9ww'], {price: a0, intervalCount: a2});
}
Error = global.Error;
value = 'Unsupported interval type: ' + a1 + ', and interval count: ' + a2;
throw new Error();
}
if (a2 === 1) {
return intl.formatToPlainString(t.AbOLNu, {price: a0});
}
MONTH = SubscriptionIntervalTypes.MONTH;
if (a1 !== MONTH) {
Error = global.Error;
value = 'Unsupported interval type: ' + a1 + ', and interval count: ' + a2;
throw new Error();
}
if (a2 > 1) {
return intl.formatToPlainString(t['Qc+9ww'], {price: a0, intervalCount: a2});
}
Error = global.Error;
value = 'Unsupported interval type: ' + a1 + ', and interval count: ' + a2;
const value2 = Object.create(Error.prototype, {constructor: {value: Error}});
const error = new Error();
throw error instanceof Object ? error : value2;
}
function formatSubscriptionPlanRate(a0) { // fn#45268, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5315:2057, offset: 0x011863ca, size: 110 bytes, params: 2, frame: 17
const r4 = 'interval_count' in a0 ? a0.interval_count : a0.intervalCount;
const price = (require(3802) /* metro dependency 3802: PremiumUtils */).getPrice(a0.id);
return formatRate(formatPrice(price.amount, price.currency), a0.interval, r4);
}
+73
View File
@@ -0,0 +1,73 @@
/* Metro module 4664; source: utils/ProcessArgs.tsx; dependencies: [6, 7, 3767, 2] */
function _fun40372(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#40372, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4842:6, offset: 0x010fef55, size: 132 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(6) /* metro dependency 6 */;
const env0_3 = importDefault(7) /* metro dependency 7 */;
const value = _fun40373();
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/ProcessArgs.tsx');
exports.ProcessArgs = value;
}
function _fun40373() { // fn#40373, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4842:118, offset: 0x010fefd9, size: 175 bytes, params: 1, frame: 16
return env0_3(ProcessArgs, null, [{key: 'get', value: value_40375}, {key: 'contains', value: value_40376},
{key: 'isEnvVariableTrue', value: value_40377}, {key: 'isDisallowPopupsSet', value: value_40378},
{key: 'isDiscordTestSet', value: function() {
return ProcessArgs.isEnvVariableTrue('DISCORD_TEST');
}}, {key: 'isDiscordGatewayPlaintextSet', value: function() {
return false;
}}]);
}
function value_40375() { // fn#40375, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4842:216, offset: 0x010ff088, size: 175 bytes, params: 1, frame: 15
var r1;
var value2;
var value3;
var processUtils;
if (ProcessArgs.cached == null) {
value2 = environment.__proto__;
value3 = undefined;
if ((importDefault(3767) /* metro dependency 3767: DiscordNative */) == null) {
r1 = value3;
} else {
processUtils = (importDefault(3767) /* metro dependency 3767: DiscordNative */).processUtils;
r1 = processUtils == null || processUtils.getMainArgvSync == null ? value3 : processUtils.getMainArgvSync();
}
if (r1 != null && r1.length > 1) {
r1.shift();
}
r1 = r1 ?? [];
ProcessArgs.cached = r1;
}
return ProcessArgs.cached;
}
function value_40376(a0) { // fn#40376, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4842:475, offset: 0x010ff137, size: 31 bytes, params: 2, frame: 11
return ProcessArgs.get().includes(a0);
}
function value_40377(a0) { // fn#40377, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4842:557, offset: 0x010ff156, size: 141 bytes, params: 2, frame: 14
var r1;
var process;
const value2 = undefined;
if (value2 !== (importDefault(3767) /* metro dependency 3767: DiscordNative */)) {
if ((importDefault(3767) /* metro dependency 3767: DiscordNative */) == null) {
r1 = value2;
} else {
process = (importDefault(3767) /* metro dependency 3767: DiscordNative */).process;
r1 = process == null || process.env == null ? value2 : process.env[a0];
}
if (r1 === '1') {
return true;
}
if (r1 === 'true') {
return true;
}
}
return false;
}
function value_40378() { // fn#40378, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4842:754, offset: 0x010ff1e3, size: 50 bytes, params: 1, frame: 12
return ProcessArgs.contains('--disallow-popups') || ProcessArgs.isEnvVariableTrue('DISCORD_DISALLOW_POPUPS');
}
+393
View File
@@ -0,0 +1,393 @@
/* Metro module 5256; source: utils/ProcessUtils.native.tsx; dependencies: [6, 7, 15, 17, 18, 27, 5257, 2] */
function _fun46719(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#46719, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5434:6, offset: 0x011adbaf, size: 251 bytes, params: 8, frame: 19
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = importDefault(6) /* metro dependency 6 */;
const env0_1 = importDefault(7) /* metro dependency 7 */;
const env0_2 = importDefault(15) /* metro dependency 15 */;
const env0_3 = importDefault(17) /* metro dependency 17 */;
const env0_4 = importDefault(18) /* metro dependency 18 */;
const env0_5 = (require(27) /* metro dependency 27 */).NativeModules;
const ProcessUtils = (require(5257) /* metro dependency 5257: ProcessUtilsBase */).ProcessUtils;
let value = _fun46726(ProcessUtils);
value = new value();
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/ProcessUtils.native.tsx');
exports.default = value;
}
function _isNativeReflectConstruct_46720() { // fn#46720, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5434:172, offset: 0x011adcaa, 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_46720_isNativeReflectConstruct = function() {
return !!result;
})();
}
function getHermesInstrumentedStatsSummary() { // fn#46723, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5434:365, offset: 0x011add08, size: 192 bytes, params: 1, frame: 19
var r1;
var instrumentedStats;
var value3;
var value4;
var Object;
var entries;
var value5;
var filter;
var closure;
var value6;
var slice;
var value7;
var map;
var value8;
var length;
var value9;
var join;
var value10;
var error;
let value = undefined;
const HermesInternal = global.globalThis.HermesInternal;
if (HermesInternal == null) {
return value;
}
if (typeof HermesInternal !== 'object') {
return value;
}
const getInstrumentedStats = HermesInternal.getInstrumentedStats;
if (typeof getInstrumentedStats !== 'function') {
return value;
}
try {
instrumentedStats = getInstrumentedStats();
} catch (error) {
return value;
}
try {
value3 = instrumentedStats == null;
} catch (error) {
return value;
}
if (value3) {
return value;
}
try {
value4 = typeof instrumentedStats !== 'object';
} catch (error) {
return value;
}
if (value4) {
return value;
}
try {
Object = global.Object;
} catch (error) {
return value;
}
try {
entries = Object.entries;
} catch (error) {
return value;
}
try {
value5 = Reflect.apply(entries, Object, [instrumentedStats]);
} catch (error) {
return value;
}
try {
filter = value5.filter;
} catch (error) {
return value;
}
try {
closure = function(a0) {
var r1;
var r2;
var r3;
var item3;
var value3;
var iterator = a0[Symbol.iterator]();
var iterator2 = iterator.next;
var value = undefined;
var item2 = Reflect.apply(iterator2, iterator, []);
var item = item2.value;
item2 = item2.done ? undefined : iterator;
var value2 = item2 === value;
if (value2) {
}
if (value2) {
r1 = item2;
r2 = value2;
r3 = value;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r1 = item3;
r2 = value3;
r3 = value;
} else {
r1 = item3;
r2 = value3;
r3 = item;
}
}
if (!r2) {
r1.return();
}
r3 = typeof r3 === 'number' && global.Number.isFinite(r3);
return r3;
};
} catch (error) {
return value;
}
try {
value6 = Reflect.apply(filter, value5, [closure]);
} catch (error) {
return value;
}
try {
slice = value6.slice;
} catch (error) {
return value;
}
try {
value7 = Reflect.apply(slice, value6, [0, 6]);
} catch (error) {
return value;
}
try {
map = value7.map;
} catch (error) {
return value;
}
try {
closure = function(a0) {
var r0;
var r1;
var r3;
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;
var r4 = value2 ? value : item;
if (value2) {
r0 = item2;
r1 = value2;
r3 = value;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r0 = item3;
r1 = value3;
r3 = value;
} else {
r0 = item3;
r1 = value3;
r3 = item;
}
}
if (!r1) {
r0.return();
}
return '' + r4 + '=' + r3;
};
} catch (error) {
return value;
}
try {
value8 = Reflect.apply(map, value7, [closure]);
} catch (error) {
return value;
}
try {
length = value8.length;
} catch (error) {
return value;
}
try {
value9 = length > 0;
} catch (error) {
return value;
}
if (value9) {
try {
join = value8.join;
} catch (error) {
return value;
}
try {
value10 = Reflect.apply(join, value8, [', ']);
} catch (error) {
return value;
}
r1 = value10;
} else {
r1 = value;
}
return r1;
}
function _fun46726(a0) { // fn#46726, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5434:765, offset: 0x011adea0, size: 721 bytes, params: 2, frame: 16
const closure = ProcessUtilsIOS;
env0_4(closure, a0);
return env0_1(closure, [{key: 'getProcessUptime', value: function() {
return null;
}}, {key: 'getCumulativeCPUUsage', value: function() {
return this.cumulativeCpuUsage;
}}, {key: 'getCurrentCPUUsagePercent', value: function() {
return this.cpuPercentage;
}}, {key: 'getCurrentMemoryUsageKB', value: function() {
return this.memory;
}}, {key: 'setShouldCollectHermesInstrumentedStats', value: function(a0) {
this.shouldCollectHermesInstrumentedStats = a0;
var value = undefined;
this.hermesInstrumentedStatsSummary = a0 ? getHermesInstrumentedStatsSummary() : value;
return value;
}}, {key: 'getCurrentHermesInstrumentedStatsSummary', value: function() {
if (this.shouldCollectHermesInstrumentedStats) {
return this.hermesInstrumentedStatsSummary;
}
}}, {key: 'enablePerfMemoryHooks', value: function() {
return null;
}}, {key: 'disablePerfMemoryHooks', value: function() {
return null;
}}, {key: 'getPerfAttributedMemory', value: function() {
return null;
}}, {key: 'getPerfAttributedMemoryCallstacks', value: function() {
return null;
}}, {key: 'getPerfAttributedMemoryStats', value: function() {
return null;
}}, {key: 'startCPUProfiling', value: function() {
return null;
}}, {key: 'stopCPUProfiling', value: function() {
var Promise = global.Promise;
return Promise.resolve(null);
}}, {key: 'enablePAMemoryProfiler', value: function() {
return null;
}}, {key: 'disablePAMemoryProfiler', value: function() {
return null;
}}, {key: 'getPerfAttributedPAMemory', value: function() {
return null;
}}, {key: 'getPerfAttributedPAMemoryCallstacks', value: function() {
return null;
}}, {key: 'getPartitionAllocatorStats', value: function() {
return null;
}}, {key: 'enableProfilingV8Heap', value: function() {
}}, {key: 'disableProfilingV8Heap', value: function() {
}}, {key: 'getProfilerV8MemoryCallstacks', value: function() {
return null;
}}, {key: 'getMemoryUsageDetails', value: function() {
return {[0]: this.memory};
}}, {key: 'getMemoryUsageElectronRenderer', value: function() {
return null;
}}, {key: 'getMemoryPrivateUsageElectronRenderer', value: function() {
return null;
}}, {key: 'getMemoryUsageElectronRendererUsedHeapSize', value: function() {
return null;
}}, {key: 'getMemoryHeapStats', value: function() {
return null;
}}, {key: 'getBlinkMemoryInfo', value: function() {
return null;
}}, {key: 'getMemoryUsageElectronProcessTypeDetails', value: function() {
return null;
}}]);
}
function ProcessUtilsIOS() { // fn#46727, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5434:777, offset: 0x011ae171, size: 212 bytes, params: 1, frame: 21
var environment;
const value = environment.__proto__;
const binding = env1_0;
const value3 = undefined;
binding(this, ProcessUtilsIOS);
const value4 = env1_3(ProcessUtilsIOS);
const value7 = env1_2(this, _isNativeReflectConstruct_46720() ? global.Reflect.construct(value4, [],
env1_3(this).constructor) : value4.apply(this, value3));
value7.shouldCollectHermesInstrumentedStats = false;
const SystemResourceManager = NativeModules == null ? value3 : NativeModules.SystemResourceManager;
if (!(SystemResourceManager == null || SystemResourceManager.getCpuCoreCount == null)) {
SystemResourceManager.getCpuCoreCount(_fun46728);
}
global.setInterval(_fun46729, 1000);
return value7;
}
function _fun46728(a0) { // fn#46728, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5434:1137, offset: 0x011ae245, size: 20 bytes, params: 2, frame: 2
env0_0.cpuCoreCount = a0;
}
function _fun46729() { // fn#46729, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5434:1174, offset: 0x011ae259, size: 187 bytes, params: 1, frame: 14
if (!(SystemResourceManager == null || SystemResourceManager.getCurrentCpuUsagePercent == null)) {
SystemResourceManager.getCurrentCpuUsagePercent(_fun46730);
}
if (!(SystemResourceManager == null || SystemResourceManager.getCumulativeCpuUsage == null)) {
SystemResourceManager.getCumulativeCpuUsage(_fun46731);
}
if (!(SystemResourceManager == null || SystemResourceManager.getCurrentMemoryUsageKb == null)) {
SystemResourceManager.getCurrentMemoryUsageKb(_fun46732);
}
const binding = env0_0;
const shouldCollectHermesInstrumentedStats = binding.shouldCollectHermesInstrumentedStats;
const value = undefined;
binding.hermesInstrumentedStatsSummary = shouldCollectHermesInstrumentedStats ? getHermesInstrumentedStatsSummary() : value;
return value;
}
function _fun46730(a0) { // fn#46730, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5434:1252, offset: 0x011ae314, size: 34 bytes, params: 2, frame: 5
const value = a0;
const binding = env1_0;
const value3 = undefined;
binding.cpuPercentage = value >= 0 ? value : value3;
return value3;
}
function _fun46731(a0) { // fn#46731, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5434:1354, offset: 0x011ae336, size: 55 bytes, params: 2, frame: 11
var value;
var binding;
var object2;
if (a0 >= 0) {
value = environment.__proto__;
binding = env1_0;
object2 = {usage: a0};
object2.sampleTime = global.performance.now();
binding.cumulativeCpuUsage = object2;
}
}
function _fun46732(a0) { // fn#46732, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5434:1498, offset: 0x011ae36d, size: 34 bytes, params: 2, frame: 5
const value = a0;
const binding = env1_0;
const value3 = undefined;
binding.memory = value >= 0 ? value : value3;
return value3;
}
+24
View File
@@ -0,0 +1,24 @@
/* Metro module 5257; source: utils/ProcessUtilsBase.tsx; dependencies: [6, 7, 2] */
function _fun46761(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#46761, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5435:6, offset: 0x011ae3ff, size: 220 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = importDefault(6) /* metro dependency 6 */;
const env0_1 = importDefault(7) /* metro dependency 7 */;
const value = _fun46762();
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/ProcessUtilsBase.tsx');
exports.ElectronProcessType = {Unknown: 'unknown', Main: 'main', Renderer: 'renderer', GPU: 'gpu',
Utility: 'utility', Crashpad: 'crashpad', Clips: 'clips'};
exports.ProcessUtils = value;
}
function _fun46762() { // fn#46762, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5435:272, offset: 0x011ae4db, size: 128 bytes, params: 1, frame: 15
return env0_1(ProcessUtils, [{key: 'getSystemMetrics', value: function() {
var Promise = global.Promise;
return Promise.resolve(null);
}}, {key: 'setShouldCollectHermesInstrumentedStats', value: function() {
}}, {key: 'getCurrentHermesInstrumentedStatsSummary', value: function() {
}}, {key: 'getCPUCoreCount', value: function() {
return this.cpuCoreCount;
}}]);
}
+80
View File
@@ -0,0 +1,80 @@
/* Metro module 4232; source: utils/PurchaseTokenUtils.tsx; dependencies: [5, 672, 587, 491, 2] */
function _fun34937(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#34937, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4403:6, offset: 0x0106667f, size: 179 bytes, params: 8, frame: 20
const env0_0 = require;
const closure = getPurchaseToken;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(5) /* metro dependency 5 */;
const Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
const DAY = Millis.DAY;
const env0_4 = 60 * DAY;
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/PurchaseTokenUtils.tsx');
exports.getPurchaseToken = closure;
exports.getPurchaseTokenHash = function() {
return _getPurchaseTokenHash.apply(this, arguments);
};
}
function getPurchaseToken() { // fn#34938, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4403:149, offset: 0x01066732, size: 185 bytes, params: 1, frame: 18
var Date;
var value3;
var set;
var binding;
var object2;
const Storage = (require(587) /* metro dependency 587: Storage */).Storage;
const value2 = Storage.get(env0_3);
if (value2 == null) {
value3 = (require(491) /* metro dependency 491 */).v4();
set = Storage.set;
binding = env0_3;
object2 = {purchaseToken: value3};
object2.expires = global.Date.now() + env0_4;
} else {
var expires = value2.expires;
Date = global.Date;
if (expires >= Date.now()) {
return value2.purchaseToken;
}
value3 = (require(491) /* metro dependency 491 */).v4();
set = Storage.set;
binding = env0_3;
object2 = {purchaseToken: value3};
Date = global.Date;
object2.expires = Date.now() + env0_4;
}
Reflect.apply(set, Storage, [binding, object2]);
return value3;
}
function _getPurchaseTokenHash() { // fn#34939, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4403:353, offset: 0x010667eb, size: 48 bytes, params: 1, frame: 14
return env0_2(_fun34941).apply(this, arguments);
}
function* _fun34941() { // fn#34941, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4403:418, offset: 0x01066824, size: 223 bytes, params: 1, frame: 19
var environment;
if (false) {
return undefined;
}
let Uint8Array = global.Uint8Array;
value = environment.__proto__.__proto__;
value = env2_5();
value = value.split('');
value = value.map(function(a0) {
return a0.charCodeAt(0);
});
let uint8Array = new Uint8Array(value);
const subtle = global.window.crypto.subtle;
yield subtle.digest({name: 'SHA-256'}, uint8Array);
if (false) {
return undefined;
}
const btoa = global.btoa;
const String = global.String;
const fromCharCode = String.fromCharCode;
Uint8Array = global.Uint8Array;
uint8Array = new Uint8Array(uint8Array);
items = [];
arraySpread(items, uint8Array, 0, undefined);
return btoa(apply(fromCharCode, items, String, undefined));
}
+11
View File
@@ -0,0 +1,11 @@
/* Metro module 4099; source: utils/QueryStringUtils.tsx; dependencies: [2] */
function _fun33612(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#33612, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4257:6, offset: 0x01035d12, size: 85 bytes, params: 8, frame: 15
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/QueryStringUtils.tsx');
exports.getFirstQueryStringValue = function(a0) {
var value = a0;
return global.Array.isArray(value) ? value[0] : value;
};
}
+107
View File
@@ -0,0 +1,107 @@
/* Metro module 5258; source: utils/Queue.tsx; dependencies: [6, 7, 3, 13, 2] */
function _fun46768(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#46768, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5436:6, offset: 0x011ae566, size: 174 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(6) /* metro dependency 6 */;
const env0_3 = importDefault(7) /* metro dependency 7 */;
let value = importDefault(3) /* metro dependency 3: Logger */;
value = new value('Queue');
value = _fun46769();
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/Queue.tsx');
exports.default = value;
}
function _fun46769() { // fn#46769, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5436:144, offset: 0x011ae614, size: 124 bytes, params: 1, frame: 15
return env0_3(Queue, [{key: 'enqueue', value: function(a0, a1, a2) {
this.queue.push({message: a0, success: a1, logId: a2});
this._drainIfNecessary();
}}, {key: 'length', get: function() {
return this.queue.length;
}}, {key: '_drainIfNecessary', value: value_46773}, {key: 'clear', value: function() {
this.queue.clear();
global.clearTimeout(this.timeout);
this.timeout = null;
this.draining = false;
}}]);
}
function Queue() { // fn#46770, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5436:165, offset: 0x011ae690, size: 125 bytes, params: 1, frame: 16
let value = a0;
const value2 = a1;
const r4 = value !== undefined ? value : env1_4;
const r3 = value2 !== undefined ? value2 : 100;
value = environment.__proto__;
env1_2(this, Queue);
this.logger = r4;
this.defaultRetryAfter = r3;
value = importDefault(13) /* metro dependency 13 */;
value = new value();
this.queue = value;
this.timeout = null;
this.draining = false;
}
function value_46773() { // fn#46773, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5436:504, offset: 0x011ae757, size: 191 bytes, params: 1, frame: 20
var queue;
var value;
var message;
var success;
var logId;
var logger;
var log;
if (this.timeout === null) {
queue = this.queue;
if (queue.length !== 0) {
if (this.draining !== true) {
this.draining = true;
queue = this.queue;
value = queue.shift();
message = value.message;
success = value.success;
logId = value.logId;
logger = this.logger;
log = logger.log;
queue = this.queue;
Reflect.apply(log, logger,
['Draining message from queue LogId:' + logId + ' QueueLength: ' + queue.length]);
this.drain(message, _fun46774);
}
}
}
}
function _fun46774(a0, a1) { // fn#46774, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5436:764, offset: 0x011ae816, size: 269 bytes, params: 3, frame: 26
var r8;
var error;
let binding = env0_0;
let logger = binding.logger;
logger.log('Finished draining message from queue LogId:' + logId + ' QueueLength: ' + binding.queue.length);
binding.draining = false;
if (a0 == null) {
global.setImmediate(_fun46775);
try {
success(a1);
} catch (error) {
logger = env0_0.logger;
logger.error('', error);
}
} else {
r8 = a0.retryAfter ?? env0_0.defaultRetryAfter;
binding = env0_0;
logger = binding.logger;
logger.info('Rate limited. Delaying draining of queue for ' + r8 + ' ms. LogId:' + logId + ' QueueLength: ' + binding.queue.length);
binding.timeout = global.setTimeout(_fun46776, r8);
}
}
function _fun46775() { // fn#46775, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5436:916, offset: 0x011ae923, size: 19 bytes, params: 1, frame: 9
return env1_0._drainIfNecessary();
}
function _fun46776() { // fn#46776, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5436:1195, offset: 0x011ae936, size: 50 bytes, params: 1, frame: 12
const binding = env1_0;
binding.queue.unshift(env1_1);
binding.timeout = null;
binding._drainIfNecessary();
}
+74
View File
@@ -0,0 +1,74 @@
/* Metro module 10867; source: utils/RTCConnectionUtils.tsx; dependencies: [661, 1244, 2] */
function _fun83281(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#83281, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11053:6, offset: 0x01f1336f, size: 146 bytes, params: 8, frame: 18
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_2 = constantsModule.RTCConnectionStates;
const env0_3 = constantsModule.ConnectionStatus;
object2 = {getStatus: getStatus, getShortHostname: function(a0) {
return a0 == null ? '' : a0.split('.')[0];
}};
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/RTCConnectionUtils.tsx');
exports.default = object2;
}
function getStatus(a0) { // fn#83282, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11053:168, offset: 0x01f13401, size: 929 bytes, params: 2, frame: 19
var r1;
var r2;
var ERROR;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var CONNECTED;
const value = a1;
let r3 = value !== undefined ? value : false;
let CONNECTING = RTCConnectionStates.CONNECTING;
if (CONNECTING === a0) {
CONNECTING = ConnectionStatus.CONNECTING;
r1 = intl.string(t.MzW9sN);
r2 = CONNECTING;
} else if (RTCConnectionStates.AUTHENTICATING === a0) {
CONNECTING = ConnectionStatus.CONNECTING;
r1 = intl.string(t.GxXwE2);
r2 = CONNECTING;
} else if (RTCConnectionStates.AWAITING_ENDPOINT === a0) {
CONNECTING = ConnectionStatus.CONNECTING;
r1 = intl.string(t.xEbu0Q);
r2 = CONNECTING;
} else if (RTCConnectionStates.RTC_CONNECTED === a0) {
CONNECTED = ConnectionStatus.CONNECTED;
string = intl.string;
r3 = r3 ? Reflect.apply(string, intl, [t.HtVOdd]) : Reflect.apply(string, intl, [t.daXg45]);
r1 = r3;
r2 = CONNECTED;
} else if (RTCConnectionStates.RTC_CONNECTING === a0) {
CONNECTING = ConnectionStatus.CONNECTING;
r1 = intl.string(t.Gp51dl);
r2 = CONNECTING;
} else if (RTCConnectionStates.ICE_CHECKING === a0) {
CONNECTING = ConnectionStatus.CONNECTING;
r1 = intl.string(t['rdCyA/']);
r2 = CONNECTING;
} else if (RTCConnectionStates.DTLS_CONNECTING === a0) {
CONNECTING = ConnectionStatus.CONNECTING;
r1 = intl.string(t.UvB3gV);
r2 = CONNECTING;
} else if (RTCConnectionStates.NO_ROUTE === a0) {
ERROR = ConnectionStatus.ERROR;
r1 = intl.string(t.mGhOIi);
r2 = ERROR;
} else if (RTCConnectionStates.RTC_DISCONNECTED === a0) {
ERROR = ConnectionStatus.ERROR;
r1 = intl.string(t.M7LDmE);
r2 = ERROR;
} else {
RTCConnectionStates.DISCONNECTED;
ERROR = ConnectionStatus.ERROR;
r1 = intl.string(t.NLKQbx);
r2 = ERROR;
}
return {connectionStatus: r2, connectionStatusText: r1};
}
+694
View File
@@ -0,0 +1,694 @@
/* Metro module 12533; source: utils/ReadyPayloadUtils.tsx; dependencies: [1383, 1910, 5231, 5237, 1930, 5238, 1926, 22, 44, 2] */
function _fun95762(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#95762, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:6, offset: 0x0214d6f7, size: 258 bytes, params: 8, frame: 19
let env0_0 = require;
const _arrayLikeToArray_95765 = 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 restoreUsers = function(a0, a1) {
var env0_0 = a0;
if (a1 != null) {
a1.forEach(_fun95769);
}
return [];
};
const closure = hydratePreviouslyUnavailableGuild;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = (require(1383) /* metro dependency 1383: ChannelRecord */).createChannelRecordFromServer;
const env0_5 = {};
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/ReadyPayloadUtils.tsx');
exports.hydrateReadySupplementalPayload = hydrateReadySupplementalPayload;
exports.preloadReadyPayloadData = preloadReadyPayloadData;
exports.hydrateReadyPayloadPrioritized = hydrateReadyPayloadPrioritized;
exports.hydrateInitialGuild = function(a0, a1) {
var value2 = hydratePreviouslyUnavailableGuild(a0);
env0_4 = {guild: a0, identifyTime: a1};
return value2;
};
exports.hydratePreviouslyUnavailableGuild = closure;
}
function _createForOfIteratorHelperLoose_95763(a0, a1) { // fn#95763, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:142, offset: 0x0214d7f9, size: 372 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 _fun95764;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_95765(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_95765(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_95765(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun95764;
}
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 maybeIncludeInitialGuild(a0, a1, a2) { // fn#95766, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:1068, offset: 0x0214d96d, size: 90 bytes, params: 4, frame: 14
const value2 = null;
return value2 == env0_4 || env0_4.identifyTime !== a0 ? value2 : value2 == a1 ? a2(env0_4.guild) : a1.some(_fun95767) ? value2 : a2(env0_4.guild);
}
function restoreUsers(a0, a1) { // fn#95768, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:1201, offset: 0x0214d9e6, size: 45 bytes, params: 3, frame: 12
const env0_0 = a0;
if (a1 != null) {
a1.forEach(_fun95769);
}
return [];
}
function hydrateGuild(a0) { // fn#95770, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:1422, offset: 0x0214da97, size: 885 bytes, params: 2, frame: 19
var r7;
var r1;
var r6;
var r3;
var r0;
var object6;
var object7;
var partial_updates;
var channels;
var value;
var value2;
var deleted_channel_ids;
var object8;
var emojis;
var deleted_emoji_ids;
var properties;
var object10;
var roles;
var deleted_role_ids;
var object11;
var stickers;
var deleted_sticker_ids;
var threads;
var collectThreadMessagesBinding;
var object12;
const env0_0 = a0;
if (a0.data_mode !== 'partial') {
object6 = {};
object6.id = a0.id;
object6.dataMode = a0.data_mode;
object6.emojis = {op: 'full_sync', items: a0.emojis};
object6.guild_scheduled_events = a0.guild_scheduled_events;
object6.experiments = a0.experiments;
object6.joined_at = a0.joined_at;
object6.lastMessages = a0.last_messages;
object6.member_count = a0.member_count;
object6.members = a0.members;
object6.premium_subscription_count = a0.premium_subscription_count;
object6.properties = a0.properties;
object6.roles = {op: 'full_sync', items: a0.roles};
object6.stage_instances = a0.stage_instances;
object6.stickers = {op: 'full_sync', items: a0.stickers};
threads = a0.threads;
r3 = threads?.map(_fun95771);
r3 = r3 ?? [];
object6.threads = r3;
collectThreadMessagesBinding = collectThreadMessages;
threads = a0.threads;
object6.threadMessages = collectThreadMessagesBinding(threads);
object12 = {op: 'full_sync'};
object12.items = a0.channels.map(_fun95772);
object6.channels = object12;
object6.version = a0.version;
object6.hasThreadsSubscription = a0.has_threads_subscription;
r0 = object6;
} else {
object6 = {};
object6.id = a0.id;
object6.dataMode = a0.data_mode;
object7 = {op: 'update'};
partial_updates = a0.partial_updates;
channels = partial_updates.channels;
value = null;
value2 = undefined;
r7 = value == channels ? value2 : channels.map(_fun95773);
r7 = value == r7 ? [] : r7;
object7.writes = r7;
partial_updates = a0.partial_updates;
deleted_channel_ids = partial_updates.deleted_channel_ids;
r7 = value != deleted_channel_ids ? deleted_channel_ids : [];
object7.deletes = r7;
object6.channels = object7;
object6.channelTimestampUpdates = a0.channel_updates;
object8 = {op: 'update'};
partial_updates = a0.partial_updates;
emojis = partial_updates.emojis;
r7 = value != emojis ? emojis : [];
object8.writes = r7;
partial_updates = a0.partial_updates;
deleted_emoji_ids = partial_updates.deleted_emoji_ids;
r7 = value != deleted_emoji_ids ? deleted_emoji_ids : [];
object8.deletes = r7;
object6.emojis = object8;
object6.guild_scheduled_events = a0.guild_scheduled_events;
object6.experiments = a0.experiments;
object6.joined_at = a0.joined_at;
object6.lastMessages = a0.last_messages;
object6.member_count = a0.member_count;
object6.members = a0.members;
object6.premium_subscription_count = a0.premium_subscription_count;
properties = a0.properties;
r1 = value != properties ? properties : value;
object6.properties = r1;
object10 = {op: 'update'};
partial_updates = a0.partial_updates;
roles = partial_updates.roles;
r7 = value != roles ? roles : [];
object10.writes = r7;
partial_updates = a0.partial_updates;
deleted_role_ids = partial_updates.deleted_role_ids;
r7 = value != deleted_role_ids ? deleted_role_ids : [];
object10.deletes = r7;
object6.roles = object10;
object6.stage_instances = a0.stage_instances;
object11 = {op: 'update'};
partial_updates = a0.partial_updates;
stickers = partial_updates.stickers;
r6 = value != stickers ? stickers : [];
object11.writes = r6;
partial_updates = a0.partial_updates;
deleted_sticker_ids = partial_updates.deleted_sticker_ids;
r6 = value != deleted_sticker_ids ? deleted_sticker_ids : [];
object11.deletes = r6;
object6.stickers = object11;
object6.unableToSyncDeletes = a0.unable_to_sync_deletes;
threads = a0.threads;
r1 = value == threads ? value2 : threads.map(_fun95774);
r1 = value == r1 ? [] : r1;
object6.threads = r1;
collectThreadMessagesBinding = collectThreadMessages;
threads = a0.threads;
object6.threadMessages = collectThreadMessagesBinding(threads);
object6.version = a0.version;
object6.hasThreadsSubscription = a0.has_threads_subscription;
r0 = object6;
}
return r0;
}
function hydratePreviouslyUnavailableGuild(a0) { // fn#95775, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:3377, offset: 0x0214de57, size: 929 bytes, params: 2, frame: 19
var r7;
var r1;
var r6;
var r2;
var r0;
var object6;
var object7;
var partial_updates;
var channels;
var value;
var value2;
var deleted_channel_ids;
var object8;
var emojis;
var deleted_emoji_ids;
var properties;
var object10;
var roles;
var deleted_role_ids;
var object11;
var stickers;
var deleted_sticker_ids;
var threads;
var collectThreadMessagesBinding;
var object12;
const env0_0 = a0;
if (a0.data_mode !== 'partial') {
object6 = {};
object6.id = a0.id;
object6.guild_scheduled_events = a0.guild_scheduled_events;
object6.experiments = a0.experiments;
object6.joined_at = a0.joined_at;
object6.lastMessages = a0.last_messages;
object6.member_count = a0.member_count;
object6.members = a0.members;
object6.premium_subscription_count = a0.premium_subscription_count;
object6.properties = a0.properties;
object6.roles = {op: 'full_sync', items: a0.roles};
object6.stage_instances = a0.stage_instances;
threads = a0.threads;
r2 = threads?.map(_fun95776);
r2 = r2 ?? [];
object6.threads = r2;
collectThreadMessagesBinding = collectThreadMessages;
threads = a0.threads;
object6.threadMessages = collectThreadMessagesBinding(threads);
object6.presences = a0.presences;
object6.activity_instances = a0.activity_instances;
object6.voice_states = a0.voice_states;
object6.version = a0.version;
object6.hasThreadsSubscription = a0.has_threads_subscription;
object6.emojis = {op: 'full_sync', items: a0.emojis};
object6.stickers = {op: 'full_sync', items: a0.stickers};
object12 = {op: 'full_sync'};
object12.items = a0.channels.map(_fun95777);
object6.channels = object12;
r0 = object6;
} else {
object6 = {};
object6.id = a0.id;
object7 = {op: 'update'};
partial_updates = a0.partial_updates;
channels = partial_updates.channels;
value = null;
value2 = undefined;
r7 = value == channels ? value2 : channels.map(_fun95778);
r7 = value == r7 ? [] : r7;
object7.writes = r7;
partial_updates = a0.partial_updates;
deleted_channel_ids = partial_updates.deleted_channel_ids;
r7 = value != deleted_channel_ids ? deleted_channel_ids : [];
object7.deletes = r7;
object6.channels = object7;
object6.channelTimestampUpdates = a0.channel_updates;
object6.activity_instances = a0.activity_instances;
object8 = {op: 'update'};
partial_updates = a0.partial_updates;
emojis = partial_updates.emojis;
r7 = value != emojis ? emojis : [];
object8.writes = r7;
partial_updates = a0.partial_updates;
deleted_emoji_ids = partial_updates.deleted_emoji_ids;
r7 = value != deleted_emoji_ids ? deleted_emoji_ids : [];
object8.deletes = r7;
object6.emojis = object8;
object6.guild_scheduled_events = a0.guild_scheduled_events;
object6.experiments = a0.experiments;
object6.joined_at = a0.joined_at;
object6.lastMessages = a0.last_messages;
object6.member_count = a0.member_count;
object6.members = a0.members;
object6.premium_subscription_count = a0.premium_subscription_count;
object6.presences = a0.presences;
properties = a0.properties;
r1 = value != properties ? properties : value;
object6.properties = r1;
object10 = {op: 'update'};
partial_updates = a0.partial_updates;
roles = partial_updates.roles;
r7 = value != roles ? roles : [];
object10.writes = r7;
partial_updates = a0.partial_updates;
deleted_role_ids = partial_updates.deleted_role_ids;
r7 = value != deleted_role_ids ? deleted_role_ids : [];
object10.deletes = r7;
object6.roles = object10;
object6.stage_instances = a0.stage_instances;
object11 = {op: 'update'};
partial_updates = a0.partial_updates;
stickers = partial_updates.stickers;
r6 = value != stickers ? stickers : [];
object11.writes = r6;
partial_updates = a0.partial_updates;
deleted_sticker_ids = partial_updates.deleted_sticker_ids;
r6 = value != deleted_sticker_ids ? deleted_sticker_ids : [];
object11.deletes = r6;
object6.stickers = object11;
object6.unableToSyncDeletes = a0.unable_to_sync_deletes;
threads = a0.threads;
r1 = value == threads ? value2 : threads.map(_fun95779);
r1 = value == r1 ? [] : r1;
object6.threads = r1;
collectThreadMessagesBinding = collectThreadMessages;
threads = a0.threads;
object6.threadMessages = collectThreadMessagesBinding(threads);
object6.voice_states = a0.voice_states;
object6.version = a0.version;
object6.hasThreadsSubscription = a0.has_threads_subscription;
r0 = object6;
}
return r0;
}
function collectThreadMessages(a0) { // fn#95780, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:5491, offset: 0x0214e1f8, size: 87 bytes, params: 2, frame: 15
var r2;
var value;
var value2;
var done;
var value3;
var most_recent_message;
var push;
var value4;
const items2 = [];
if (a0 != null) {
value = _createForOfIteratorHelperLoose_95763(a0);
value2 = value();
done = value2.done;
if (!done) {
r2 = value2;
while (true) {
value3 = r2.value;
most_recent_message = value3.most_recent_message;
if (most_recent_message != null) {
push = items2.push;
most_recent_message = value3.most_recent_message;
Reflect.apply(push, items2, [most_recent_message]);
}
value4 = value();
done = value4.done;
if (done) {
break;
}
r2 = value4;
continue;
}
}
}
return items2;
}
function hydrateReadySupplementalPayload(a0, a1) { // fn#95781, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:5787, offset: 0x0214e24f, size: 209 bytes, params: 3, frame: 21
const guilds = a0.guilds;
const env0_0 = a0.merged_members;
const merged_presences = a0.merged_presences;
const object3 = {'guilds': 0, 'merged_members': 0, 'merged_presences': 0};
silentSetPrototypeOf(object3, null, undefined);
const value = copyDataProperties({}, a0, object3, undefined);
const restoreUsersBinding = restoreUsers;
const binding = env0_5;
const value3 = undefined;
const value4 = restoreUsersBinding(binding, merged_presences == null ? value3 : merged_presences.friends);
let r2 = guilds == null ? value3 : guilds.map(_fun95782);
r2 = r2 ?? [];
const value6 = maybeIncludeInitialGuild(a1, guilds, function(a0) {
return {id: a0.id, members: a0.members, presences: a0.presences, activity_instances: a0.activity_instances,
voice_states: a0.voice_states, unavailable: false};
});
if (value6 != null) {
r2.push(value6);
}
env0_5 = {};
const object4 = {};
copyDataProperties(object4, value, object3);
object4['presences'] = value4;
object4['guilds'] = r2;
return object4;
}
function preloadReadyPayloadData() { // fn#95784, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:6399, offset: 0x0214e3f2, size: 337 bytes, params: 1, frame: 16
var r4;
var r3;
var Promise;
var resolve;
var Set;
var value5;
var set;
var value;
let value2 = (importDefault(1910) /* metro dependency 1910: DatabaseDaos */).database();
const isCacheEnabledNativeModule = require(5231) /* metro dependency 5231: isCacheEnabledNative */;
const r5 = isCacheEnabledNativeModule.isCacheEnabled() ? (importDefault(5237) /* metro dependency 5237: GuildVersions */).getCommittedVersions() : global.Promise.resolve({});
const moduleValue2 = isCacheEnabledNativeModule;
if (moduleValue2.isCacheEnabled()) {
r4 = (importDefault(1930) /* metro dependency 1930: ChannelReader */).getGuildIds();
} else {
Promise = global.Promise;
resolve = Promise.resolve;
Set = global.Set;
value5 = Object.create(Set.prototype, {constructor: {value: Set}});
set = new Set();
r4 = Reflect.apply(resolve, Promise, [set instanceof Object ? set : value5]);
}
if (value2 != null) {
value = importDefault(5238) /* metro dependency 5238: KvCacheVersion */;
value = value.okAsync(value2);
r3 = value;
} else {
r3 = global.Promise.resolve(false);
}
Promise = global.Promise;
return Promise.all([r5, r4, r3]).then(function(a0) {
var r0;
var r2;
var r4;
var r1;
var item3;
var value3;
var item4;
var value4;
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;
var r3 = value2 ? value : item;
if (value2) {
r0 = item2;
r2 = value;
r4 = value2;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r0 = item3;
r2 = value;
r4 = value3;
} else {
r0 = item3;
r2 = item;
r4 = value3;
}
}
if (r4) {
r1 = value;
} else {
item4 = Reflect.apply(iterator2, r0, []);
item = item4.value;
item4 = item4.done ? undefined : r0;
value4 = item4 === value;
if (value4) {
r0 = item4;
r1 = value;
r4 = value4;
} else {
r0 = item4;
r1 = item;
r4 = value4;
}
}
if (!r4) {
r0.return();
}
return {guildVersions: r3, guildChannels: r2, databaseOk: r1};
});
}
function hydrateReadyPayloadPrioritized(a0, a1, a2) { // fn#95786, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:6797, offset: 0x0214e5b3, size: 362 bytes, params: 4, frame: 21
const users = a0.users;
const private_channels = a0.private_channels;
const env0_0 = a0.merged_members;
const guilds = a0.guilds;
const object3 = {'users': 0, 'private_channels': 0, 'merged_members': 0, 'guilds': 0};
silentSetPrototypeOf(object3, null, undefined);
const value = copyDataProperties({}, a0, object3, undefined);
const value3 = undefined;
const defaultImport = importDefault(1910) /* metro dependency 1910: DatabaseDaos */;
let r4 = defaultImport.database() != null && a2.databaseOk === false;
if (r4) {
(importDefault(1926) /* metro dependency 1926: DatabaseManager */).replaceDisableAllDatabases('ReadyPayloadUtils: database was not ok');
}
env0_5 = (importDefault(22) /* metro dependency 22 */).keyBy(users, function(a0) {
return a0.id;
});
if (private_channels != null) {
private_channels.forEach(function(a0) {
var recipient_ids = a0.recipient_ids;
if (recipient_ids != null) {
a0.recipients = recipient_ids.map(_fun95789);
}
delete a0.recipient_ids;
});
}
r4 = guilds == null ? value3 : guilds.map(_fun95790);
r4 = r4 ?? [];
const value7 = maybeIncludeInitialGuild(a1, guilds, function(a0) {
return hydrateGuild(a0);
});
if (value7 != null) {
r4.push(value7);
}
const object4 = {};
copyDataProperties(object4, value, object3);
object4['users'] = users;
object4['presences'] = [];
object4['guilds'] = r4;
object4['private_channels'] = private_channels ?? [];
return object4;
}
function _fun95767({id}) { // fn#95767, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:1162, offset: 0x0214d9c7, size: 31 bytes, params: 2, frame: 2
return id === env1_4.guild.id;
}
function _fun95769(a0) { // fn#95769, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:1264, offset: 0x0214da13, size: 132 bytes, params: 2, frame: 18
var user_id;
var value;
var binding;
if (a0 != null) {
user_id = a0.user_id;
if (user_id != null) {
value = environment.__proto__;
value = importDefault(44) /* metro dependency 44 */;
binding = env0_0;
value(binding[user_id] != null, 'Missing user[' + user_id + '] in compressed ready payload');
a0.user = binding[user_id];
}
delete a0.user_id;
binding = env0_1;
binding.push(a0);
}
}
function _fun95771(a0) { // fn#95771, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:1994, offset: 0x0214de0c, size: 32 bytes, params: 2, frame: 13
return createChannelRecordFromServer(a0, env0_0.id);
}
function _fun95772(a0) { // fn#95772, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:2110, offset: 0x0214de2c, size: 43 bytes, params: 2, frame: 13
const binding = env0_0;
a0.guild_id = binding.id;
return createChannelRecordFromServer(a0, binding.id);
}
function _fun95782(a0, a1) { // fn#95782, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:5965, offset: 0x0214e320, size: 143 bytes, params: 3, frame: 19
var r2;
var r9;
var guilds;
let value = environment.__proto__;
const restoreUsersBinding = restoreUsers;
const binding = env1_5;
const value3 = merged_presences == null;
const value4 = undefined;
if (value3) {
r2 = value4;
r9 = value3;
} else {
guilds = merged_presences.guilds;
r2 = guilds[a1];
r9 = guilds;
}
const value5 = restoreUsersBinding(binding, r2);
value = restoreUsers(env1_5, merged_members == null ? value4 : merged_members[a1]);
const object2 = {};
copyDataProperties(object2, a0, r9);
object2['unavailable'] = value4 === a0.voice_states;
object2['presences'] = value5;
object2['members'] = value;
return object2;
}
function _fun95788(a0) { // fn#95788, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:7082, offset: 0x0214e71d, size: 49 bytes, params: 2, frame: 12
const recipient_ids = a0.recipient_ids;
if (recipient_ids != null) {
a0.recipients = recipient_ids.map(_fun95789);
}
delete a0.recipient_ids;
}
function _fun95790(a0, a1) { // fn#95790, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:7278, offset: 0x0214e78e, size: 83 bytes, params: 3, frame: 18
var r0;
var value2;
let value = a0;
if (value.unavailable === true) {
r0 = value;
} else {
value2 = environment.__proto__;
value.members = restoreUsers(env1_5, merged_members?.[a1]);
value = hydrateGuild(value);
r0 = value;
}
return r0;
}
function _fun95789(a0) { // fn#95789, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:7138, offset: 0x0214e74e, size: 64 bytes, params: 2, frame: 15
(importDefault(44) /* metro dependency 44 */)(env2_5[a0] != null, 'Missing user in compressed ready payload');
return env2_5[a0];
}
+10
View File
@@ -0,0 +1,10 @@
/* Metro module 4100; source: utils/RegexUtils.tsx; dependencies: [2] */
function _fun33614(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#33614, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4258:6, offset: 0x01035d8a, size: 92 bytes, params: 8, frame: 16
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/RegexUtils.tsx');
exports.default = {escape: function(a0) {
return a0.replace(RegExp('[-[\\]/{}()*+?.\\\\^$|]', 'g'), '\\$&');
}};
}
+45
View File
@@ -0,0 +1,45 @@
/* Metro module 15816; source: utils/RelationshipUtils.tsx; dependencies: [661, 13914, 1423, 1244, 15817, 4603, 2] */
function _fun121553(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#121553, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16024:6, offset: 0x0254aba3, size: 148 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = (require(661) /* metro dependency 661: Constants */).FriendsSections;
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/RelationshipUtils.tsx');
exports.showPendingNotification = showPendingNotification;
exports.showAcceptedNotification = showAcceptedNotification;
}
function showNotification_121554(a0, a1, a2) { // fn#121554, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16024:122, offset: 0x0254ac37, size: 114 bytes, params: 4, frame: 20
const value = importDefault(13914) /* metro dependency 13914: NotificationActionCreators */;
const showNotification = value.showNotification;
const userAvatarURL = (importDefault(1423) /* metro dependency 1423: AvatarUtils */).getUserAvatarURL(a0);
const username = a0.username;
Reflect.apply(showNotification, value, [userAvatarURL, username, a1, {}, {'omitViewTracking': true,
'omitClickTracking': true, 'tag': null, 'onClick': null, 'isUserAvatar': true, tag: a0.id, onClick: a2}]);
}
function showPendingNotification(a0) { // fn#121555, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16024:390, offset: 0x0254aca9, size: 87 bytes, params: 2, frame: 17
const showNotification_121554Binding = showNotification_121554;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
showNotification_121554Binding(a0,
intl.string((require(1244) /* metro dependency 1244: indexNative */).t['t3+Af3']), function() {
var defaultImport = importDefault(dependencyMap[4]);
var PENDING = FriendsSections.PENDING;
defaultImport.transitionToSection(PENDING, {explicit: true});
});
}
function showAcceptedNotification(a0) { // fn#121557, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16024:576, offset: 0x0254ad3a, size: 91 bytes, params: 2, frame: 19
const env0_0 = a0;
const showNotification_121554Binding = showNotification_121554;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const MYr3Ka = (require(1244) /* metro dependency 1244: indexNative */).t.MYr3Ka;
showNotification_121554Binding(a0, Reflect.apply(string, intl, [MYr3Ka]), _fun121558);
}
function _fun121558() { // fn#121558, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16024:671, offset: 0x0254ad95, size: 57 bytes, params: 1, frame: 13
const value = environment.__proto__;
(importDefault(4603) /* metro dependency 4603: ChannelActionCreators */).openPrivateChannel({recipientIds: env0_0.id});
}
@@ -0,0 +1,28 @@
/* Metro module 4827; source: utils/ReleaseChannelUtils.native.tsx; dependencies: [1582, 477, 2] */
function _fun42096(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#42096, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5005:6, offset: 0x011302bb, size: 265 bytes, params: 8, frame: 21
var r7;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(1582) /* metro dependency 1582: ClientInfoUtils */;
const getConstants = value.getConstants;
const ReleaseChannel = Reflect.apply(getConstants, value, []).ReleaseChannel;
value = require(477) /* metro dependency 477: PlatformUtils */;
value = value.isAndroid();
if (value) {
value = ReleaseChannel.indexOf('canary');
value = value === -1;
r7 = value;
} else {
r7 = value;
}
if (r7) {
value = ReleaseChannel.indexOf('beta');
value = value === -1;
r7 = value;
}
const r3 = !(ReleaseChannel.indexOf('debug') !== -1 || ReleaseChannel.indexOf('developer') !== -1) && (ReleaseChannel === 'stable' || r7);
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/ReleaseChannelUtils.native.tsx');
exports.isStable = r3;
exports.CurrentReleaseChannel = ReleaseChannel;
}
+71
View File
@@ -0,0 +1,71 @@
/* Metro module 6894; source: utils/ReportUtils.tsx; dependencies: [1379, 4111, 3784, 1878, 661, 2] */
function _fun54740(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#54740, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7072:6, offset: 0x0136d164, size: 233 bytes, params: 8, frame: 22
const closure = canReportUser;
const closure2 = canReportMessage;
const closure3 = canReportAndDeleteInChannel;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const guildMemberCountStore = importDefault(4111) /* metro dependency 4111: GuildMemberCountStore */;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_4 = constantsModule.ChannelTypes;
const env0_5 = constantsModule.Permissions;
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/ReportUtils.tsx');
exports.canReportUser = closure;
exports.canReportMessage = closure2;
exports.canReportAndDeleteInChannel = closure3;
exports.canDeleteAndReportMessage = canDeleteAndReportMessage;
}
function canReportUser(a0) { // fn#54741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7072:179, offset: 0x0136d24d, size: 70 bytes, params: 2, frame: 12
if (a0 == null) {
return false;
}
const id = a0.id;
const currentUser = UserStore.getCurrentUser();
return currentUser != null && (currentUser.id !== id && a0.system !== true);
}
function canReportMessage(a0) { // fn#54742, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7072:299, offset: 0x0136d293, size: 34 bytes, params: 2, frame: 12
return a0 != null && canReportUser(a0.author);
}
function canReportAndDeleteInChannel(a0) { // fn#54743, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7072:368, offset: 0x0136d2b5, size: 155 bytes, params: 2, frame: 17
var value;
const channel = ChannelStore.getChannel(a0);
if (channel != null) {
var type = channel.type;
var DM = ChannelTypes.DM;
if (type === DM) {
return true;
}
type = channel.type;
var GROUP_DM = ChannelTypes.GROUP_DM;
if (type === GROUP_DM) {
return true;
}
var canWithPartialContext = PermissionStore.canWithPartialContext;
var MANAGE_MESSAGES = Permissions.MANAGE_MESSAGES;
if (Reflect.apply(canWithPartialContext, PermissionStore, [MANAGE_MESSAGES, {channelId: a0}])) {
value = GuildMemberCountStore.getMemberCount(channel.getGuildId());
return value != null && value >= 50;
}
}
return false;
}
function canDeleteAndReportMessage(a0) { // fn#54744, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7072:835, offset: 0x0136d350, size: 55 bytes, params: 2, frame: 12
var canReportAndDeleteInChannelBinding;
let value = a0 != null;
let r0 = value && canReportMessage(a0);
if (r0) {
canReportAndDeleteInChannelBinding = canReportAndDeleteInChannel;
value = a0.getChannelId();
value = canReportAndDeleteInChannelBinding(value);
r0 = value;
}
return r0;
}
+390
View File
@@ -0,0 +1,390 @@
/* Metro module 9991; source: utils/SKUUtils.tsx; dependencies: [57, 661, 3974, 1244, 4141, 477, 3738, 2] */
function _fun78099(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#78099, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10177:6, offset: 0x01e1914c, size: 427 bytes, params: 8, frame: 21
const env0_0 = require;
let Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
let value = require(661) /* metro dependency 661: Constants */;
const GameGenres = value.GameGenres;
const env0_5 = value.SKUTypes;
const env0_6 = value.Routes;
const env0_7 = value.SKUProductLines;
const env0_8 = {};
const env0_9 = {};
Object = global.Object;
const freeze = Object.freeze;
object = {ALL: -1};
copyDataProperties(object, GameGenres, undefined);
value = Reflect.apply(freeze, Object, [object]);
Object = global.Object;
value = Object.keys(value);
value.forEach(_fun78100);
object = [['YYYY-MM-DD', 'MMMM DD, Y'], ['YYYY-MM', 'MMMM Y'], ['MM-DD', 'MMMM DD'], ['MM', 'MMMM'], ['YYYY', 'Y']];
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/SKUUtils.tsx');
exports.getSKUIdFromURL = getSKUIdFromURL;
exports.getGenreURLSlugFromId = getGenreURLSlugFromId;
exports.getGenreIdFromURLSlug = getGenreIdFromURLSlug;
exports.getGenreText = getGenreText;
exports.canUserInstall = canUserInstall;
exports.getReadablePreorderReleaseDate = getReadablePreorderReleaseDate;
exports.isThirdPartySKU = function(a0) {
return a0 === SKUProductLines.SOCIAL_LAYER_GAME_ITEM;
};
}
function _fun78100(a0) { // fn#78100, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10177:242, offset: 0x01e192f7, size: 73 bytes, params: 2, frame: 14
let value = a0.toLowerCase();
value = value.replace(RegExp('_', 'g'), '-');
const property = env0_10[a0];
env0_8[value] = property;
env0_9[property] = value;
}
function getSKUIdFromURL(a0) { // fn#78101, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10177:484, offset: 0x01e19340, size: 97 bytes, params: 2, frame: 16
const matchPathCompatModule = require(3974) /* metro dependency 3974: matchPathCompat */;
const matchPath = matchPathCompatModule.matchPath;
const object2 = {};
object2.path = Routes.APPLICATION_STORE_LISTING_SKU(':skuId', ':slug');
const value = Reflect.apply(matchPath, matchPathCompatModule, [a0, object2]);
const value2 = null;
return value2 != value ? value.params.skuId : value2;
}
function getGenreURLSlugFromId(a0) { // fn#78102, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10177:656, offset: 0x01e193a1, size: 16 bytes, params: 2, frame: 2
return env0_9[a0];
}
function getGenreText(a0) { // fn#78104, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10177:789, offset: 0x01e193b1, size: 5446 bytes, params: 2, frame: 15
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const ACTION = GameGenres.ACTION;
if (ACTION === a0) {
return intl.string(t['1o2/IM']);
}
const ACTION_RPG = GameGenres.ACTION_RPG;
if (ACTION_RPG === a0) {
return intl.string(t.e9Yo4H);
}
const BRAWLER = GameGenres.BRAWLER;
if (BRAWLER === a0) {
return intl.string(t.WCkEjT);
}
const HACK_AND_SLASH = GameGenres.HACK_AND_SLASH;
if (HACK_AND_SLASH === a0) {
return intl.string(t.xQ4VmK);
}
const PLATFORMER = GameGenres.PLATFORMER;
if (PLATFORMER === a0) {
return intl.string(t.WA3189);
}
const STEALTH = GameGenres.STEALTH;
if (STEALTH === a0) {
return intl.string(t['6UPFdw']);
}
const SURVIVAL = GameGenres.SURVIVAL;
if (SURVIVAL === a0) {
return intl.string(t.SVPCt9);
}
const ADVENTURE = GameGenres.ADVENTURE;
if (ADVENTURE === a0) {
return intl.string(t['15p8on']);
}
const ACTION_ADVENTURE = GameGenres.ACTION_ADVENTURE;
if (ACTION_ADVENTURE === a0) {
return intl.string(t.AxkUBp);
}
const METROIDVANIA = GameGenres.METROIDVANIA;
if (METROIDVANIA === a0) {
return intl.string(t.Iwr38m);
}
const OPEN_WORLD = GameGenres.OPEN_WORLD;
if (OPEN_WORLD === a0) {
return intl.string(t['2HRHJO']);
}
const PSYCHOLOGICAL_HORROR = GameGenres.PSYCHOLOGICAL_HORROR;
if (PSYCHOLOGICAL_HORROR === a0) {
return intl.string(t['/IwK3s']);
}
const SANDBOX = GameGenres.SANDBOX;
if (SANDBOX === a0) {
return intl.string(t['2+Vu4Q']);
}
const SURVIVAL_HORROR = GameGenres.SURVIVAL_HORROR;
if (SURVIVAL_HORROR === a0) {
return intl.string(t.CCzRiK);
}
const VISUAL_NOVEL = GameGenres.VISUAL_NOVEL;
if (VISUAL_NOVEL === a0) {
return intl.string(t.FE7rnk);
}
const DRIVING_RACING = GameGenres.DRIVING_RACING;
if (DRIVING_RACING === a0) {
return intl.string(t.Erzgca);
}
const VEHICULAR_COMBAT = GameGenres.VEHICULAR_COMBAT;
if (VEHICULAR_COMBAT === a0) {
return intl.string(t.YQHhog);
}
const MASSIVELY_MULTIPLAYER = GameGenres.MASSIVELY_MULTIPLAYER;
if (MASSIVELY_MULTIPLAYER === a0) {
return intl.string(t['5CNg1o']);
}
const MMORPG = GameGenres.MMORPG;
if (MMORPG === a0) {
return intl.string(t['c4NuO/']);
}
const ROLE_PLAYING = GameGenres.ROLE_PLAYING;
if (ROLE_PLAYING === a0) {
return intl.string(t.yayVgs);
}
const DUNGEON_CRAWLER = GameGenres.DUNGEON_CRAWLER;
if (DUNGEON_CRAWLER === a0) {
return intl.string(t.qicemc);
}
const ROGUELIKE = GameGenres.ROGUELIKE;
if (ROGUELIKE === a0) {
return intl.string(t.zWzaCv);
}
const SHOOTER = GameGenres.SHOOTER;
if (SHOOTER === a0) {
return intl.string(t['+pk6sd']);
}
const LIGHT_GUN = GameGenres.LIGHT_GUN;
if (LIGHT_GUN === a0) {
return intl.string(t.TDS96y);
}
const SHOOT_EM_UP = GameGenres.SHOOT_EM_UP;
if (SHOOT_EM_UP === a0) {
return intl.string(t.wltDUE);
}
const FPS = GameGenres.FPS;
if (FPS === a0) {
return intl.string(t.olTaq4);
}
const DUAL_JOYSTICK_SHOOTER = GameGenres.DUAL_JOYSTICK_SHOOTER;
if (DUAL_JOYSTICK_SHOOTER === a0) {
return intl.string(t['SN+NS3']);
}
const SIMULATION = GameGenres.SIMULATION;
if (SIMULATION === a0) {
return intl.string(t.sxMPdm);
}
const FLIGHT_SIMULATOR = GameGenres.FLIGHT_SIMULATOR;
if (FLIGHT_SIMULATOR === a0) {
return intl.string(t['Q7msr+']);
}
const TRAIN_SIMULATOR = GameGenres.TRAIN_SIMULATOR;
if (TRAIN_SIMULATOR === a0) {
return intl.string(t.ZtECf3);
}
const LIFE_SIMULATOR = GameGenres.LIFE_SIMULATOR;
if (LIFE_SIMULATOR === a0) {
return intl.string(t.byt5Fo);
}
const FISHING = GameGenres.FISHING;
if (FISHING === a0) {
return intl.string(t.BKwiwY);
}
const SPORTS = GameGenres.SPORTS;
if (SPORTS === a0) {
return intl.string(t.O0B7XM);
}
const BASEBALL = GameGenres.BASEBALL;
if (BASEBALL === a0) {
return intl.string(t['jPYb/z']);
}
const BASKETBALL = GameGenres.BASKETBALL;
if (BASKETBALL === a0) {
return intl.string(t['o+D1Bm']);
}
const BILLIARDS = GameGenres.BILLIARDS;
if (BILLIARDS === a0) {
return intl.string(t.PJ5o4E);
}
const BOWLING = GameGenres.BOWLING;
if (BOWLING === a0) {
return intl.string(t['82afJw']);
}
const BOXING = GameGenres.BOXING;
if (BOXING === a0) {
return intl.string(t.DQvfei);
}
const FOOTBALL = GameGenres.FOOTBALL;
if (FOOTBALL === a0) {
return intl.string(t.slOYkj);
}
const GOLF = GameGenres.GOLF;
if (GOLF === a0) {
return intl.string(t.aeQPlG);
}
const HOCKEY = GameGenres.HOCKEY;
if (HOCKEY === a0) {
return intl.string(t.g7oe5X);
}
const SKATEBOARDING_SKATING = GameGenres.SKATEBOARDING_SKATING;
if (SKATEBOARDING_SKATING === a0) {
return intl.string(t.yBDEP0);
}
const SNOWBOARDING_SKIING = GameGenres.SNOWBOARDING_SKIING;
if (SNOWBOARDING_SKIING === a0) {
return intl.string(t.GVaAci);
}
const SOCCER = GameGenres.SOCCER;
if (SOCCER === a0) {
return intl.string(t.KPznxl);
}
const TRACK_FIELD = GameGenres.TRACK_FIELD;
if (TRACK_FIELD === a0) {
return intl.string(t['hJ62Q/']);
}
const SURFING_WAKEBOARDING = GameGenres.SURFING_WAKEBOARDING;
if (SURFING_WAKEBOARDING === a0) {
return intl.string(t.PSh0CV);
}
const WRESTLING = GameGenres.WRESTLING;
if (WRESTLING === a0) {
return intl.string(t['3y9hAT']);
}
const STRATEGY = GameGenres.STRATEGY;
if (STRATEGY === a0) {
return intl.string(t.KovTD8);
}
const FOUR_X = GameGenres.FOUR_X;
if (FOUR_X === a0) {
return intl.string(t['19h4dX']);
}
const ARTILLERY = GameGenres.ARTILLERY;
if (ARTILLERY === a0) {
return intl.string(t.sBqLsP);
}
const RTS = GameGenres.RTS;
if (RTS === a0) {
return intl.string(t.yS4ddj);
}
const TOWER_DEFENSE = GameGenres.TOWER_DEFENSE;
if (TOWER_DEFENSE === a0) {
return intl.string(t.SULyIO);
}
const TURN_BASED_STRATEGY = GameGenres.TURN_BASED_STRATEGY;
if (TURN_BASED_STRATEGY === a0) {
return intl.string(t.VDsbru);
}
const WARGAME = GameGenres.WARGAME;
if (WARGAME === a0) {
return intl.string(t.YDCIrO);
}
const MOBA = GameGenres.MOBA;
if (MOBA === a0) {
return intl.string(t.i1m1t8);
}
const FIGHTING = GameGenres.FIGHTING;
if (FIGHTING === a0) {
return intl.string(t.KepcSI);
}
const PUZZLE = GameGenres.PUZZLE;
if (PUZZLE === a0) {
return intl.string(t.rm7Ggs);
}
const CARD_GAME = GameGenres.CARD_GAME;
if (CARD_GAME === a0) {
return intl.string(t.kX85vy);
}
const EDUCATION = GameGenres.EDUCATION;
if (EDUCATION === a0) {
return intl.string(t.klIi67);
}
const FITNESS = GameGenres.FITNESS;
if (FITNESS === a0) {
return intl.string(t.GOaaFb);
}
const GAMBLING = GameGenres.GAMBLING;
if (GAMBLING === a0) {
return intl.string(t['X8/Ee9']);
}
const MUSIC_RHYTHM = GameGenres.MUSIC_RHYTHM;
if (MUSIC_RHYTHM === a0) {
return intl.string(t.qPgrgw);
}
const PARTY_MINI_GAME = GameGenres.PARTY_MINI_GAME;
if (PARTY_MINI_GAME === a0) {
return intl.string(t.diBclF);
}
const PINBALL = GameGenres.PINBALL;
if (PINBALL === a0) {
return intl.string(t['1+ottx']);
}
const TRIVIA_BOARD_GAME = GameGenres.TRIVIA_BOARD_GAME;
if (TRIVIA_BOARD_GAME === a0) {
return intl.string(t.aLlxjC);
}
const TACTICAL = GameGenres.TACTICAL;
if (TACTICAL === a0) {
return intl.string(t.LRPgbt);
}
const INDIE = GameGenres.INDIE;
if (INDIE === a0) {
return intl.string(t.hz9Xvj);
}
const ARCADE = GameGenres.ARCADE;
if (ARCADE === a0) {
return intl.string(t.Sbxowr);
}
const POINT_AND_CLICK = GameGenres.POINT_AND_CLICK;
if (POINT_AND_CLICK === a0) {
return intl.string(t.vcerEn);
}
return intl.string(t['9b4eUr']);
}
function canUserInstall(a0) { // fn#78105, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10177:5333, offset: 0x01e1a8f7, size: 112 bytes, params: 2, frame: 16
const storeUtilsModule = require(4141) /* metro dependency 4141: StoreUtils */;
const nativePlatformTypeToSKUOperatingSystem = storeUtilsModule.nativePlatformTypeToSKUOperatingSystem;
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
const getPlatform = platformUtilsModule.getPlatform;
const value2 = Reflect.apply(nativePlatformTypeToSKUOperatingSystem, storeUtilsModule, [Reflect.apply(getPlatform,
platformUtilsModule, [])]);
const type = a0.type;
const DURABLE_PRIMARY = SKUTypes.DURABLE_PRIMARY;
return type === DURABLE_PRIMARY && value2 != null && a0.supportedOperatingSystems.includes(value2);
}
function getReadablePreorderReleaseDate({preorderReleaseAt, preorderApproximateReleaseDate}) { // fn#78106, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10177:5554, offset: 0x01e1a967, size: 180 bytes, params: 2, frame: 25
var r6;
var binding;
var value3;
var property;
var property2;
var value4;
var isValid;
var value5;
if (preorderReleaseAt != null) {
return preorderReleaseAt.format('MMMM DD');
}
if (preorderApproximateReleaseDate == null) {
return null;
}
let length = env0_11.length;
if (0 < length) {
r6 = 0;
loopExit3: while (true) {
binding = env0_3;
value3 = binding(env0_11[r6], 2);
property = value3[0];
property2 = value3[1];
value4 = (importDefault(3738) /* metro dependency 3738 */)(preorderApproximateReleaseDate, property, true);
isValid = value4.isValid;
if (Reflect.apply(isValid, value4, [])) {
return value4.format(property2);
}
value5 = typeof r6 === 'bigint' ? r6 + 1n : +r6 + 1;
length = env0_11.length;
if (value5 < length) {
r6 = value5;
continue;
}
break loopExit3;
}
}
return preorderApproximateReleaseDate;
}
+81
View File
@@ -0,0 +1,81 @@
/* Metro module 6274; source: utils/SecondaryIndexMapUtils.tsx; dependencies: [644, 2] */
function _fun49569(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#49569, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6452:6, offset: 0x011fd5a5, size: 97 bytes, params: 8, frame: 17
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/SecondaryIndexMapUtils.tsx');
exports.isVersionEqual = isVersionEqual;
}
function isVersionEqual(a0, a1) { // fn#49570, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6452:176, offset: 0x011fd606, size: 161 bytes, params: 3, frame: 19
var r0;
var r1;
var r2;
var r5;
var r6;
var item3;
var value3;
var item5;
var value5;
let iterator = a0[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
const value = undefined;
const value2 = item2 === value;
const r3 = value2 ? value : item;
if (value2) {
r0 = item2;
r1 = value;
r2 = value2;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r0 = item3;
r1 = value;
r2 = value3;
} else {
r0 = item3;
r1 = item;
r2 = value3;
}
}
if (!r2) {
r0.return();
}
iterator = a1[Symbol.iterator]();
const iterator3 = iterator.next;
let item4 = Reflect.apply(iterator3, iterator, []);
item = item4.value;
item4 = item4.done ? undefined : iterator;
const value4 = item4 === value;
r2 = value4 ? value : item;
if (value4) {
r0 = value;
r5 = item4;
r6 = value4;
} else {
item5 = Reflect.apply(iterator3, item4, []);
item = item5.value;
item5 = item5.done ? undefined : item4;
value5 = item5 === value;
if (value5) {
r0 = value;
r5 = item5;
r6 = value5;
} else {
r0 = item;
r5 = item5;
r6 = value5;
}
}
if (!r6) {
r5.return();
}
r0 = r1 === r0 && (importDefault(644) /* metro dependency 644 */)(r3, r2);
return r0;
}
+50
View File
@@ -0,0 +1,50 @@
/* Metro module 15175; source: utils/SecondsSliderUtils.tsx; dependencies: [1244, 3738, 2] */
function _fun115945(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#115945, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15372:6, offset: 0x0247560f, size: 103 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/SecondsSliderUtils.tsx');
exports.getSecondsSliderLabel = getSecondsSliderLabel;
}
function getSecondsSliderLabel(a0) { // fn#115946, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15372:178, offset: 0x02475676, size: 596 bytes, params: 2, frame: 20
var r4;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var formatToPlainString;
var object2;
const value = a1;
const value2 = a2;
let r2 = !(value !== undefined) || value;
let r0 = value2 !== undefined ? value2 : intl.string(t.Yl1D84);
const value3 = (importDefault(3738) /* metro dependency 3738 */).duration(a0, 'seconds');
if (value3.days() > 0) {
formatToPlainString = intl.formatToPlainString;
r2 = r2 ? t.GBLpQ8 : t['k2UNz+'];
object2 = {};
object2.days = value3.days();
r0 = Reflect.apply(formatToPlainString, intl, [r2, object2]);
} else if (value3.hours() > 0) {
formatToPlainString = intl.formatToPlainString;
r4 = r2 ? t.rhY1Rs : t.xCjYxK;
object2 = {};
object2.hours = value3.hours();
r0 = Reflect.apply(formatToPlainString, intl, [r4, object2]);
} else if (value3.minutes() > 0) {
formatToPlainString = intl.formatToPlainString;
r4 = r2 ? t['XIGt+W'] : t.iXLF9W;
object2 = {};
object2.minutes = value3.minutes();
r0 = Reflect.apply(formatToPlainString, intl, [r4, object2]);
} else if (a0 > 0) {
formatToPlainString = intl.formatToPlainString;
r4 = r2 ? t.pyvjRp : t.geSp4K;
object2 = {};
object2.seconds = value3.seconds();
r0 = Reflect.apply(formatToPlainString, intl, [r4, object2]);
} else {
r0 = r2 ? intl.string(t.Yl1D84) : r0;
}
return r0;
}
+415
View File
@@ -0,0 +1,415 @@
/* Metro module 1216; source: utils/SentryUtils.native.tsx; dependencies: [27, 3, 1217, 819, 12844, 818, 1582, 2] */
function _fun13517(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#13517, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1343:6, offset: 0x00ded430, size: 336 bytes, params: 8, frame: 19
var object2;
const env0_0 = require;
const isNonEmptyString = function(a0) {
return typeof a0 === 'string' && a0.length > 0;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_4 = (require(27) /* metro dependency 27 */).NativeModules;
let value = importDefault(3) /* metro dependency 3: Logger */;
value = new value('Sentry');
(require(1217) /* metro dependency 1217: SentryInitUtils */).initSentry();
object2 = {setUser: function(a0, a1, a2, a3) {
var object = {id: a0, username: a1, email: a2, staff: a3};
importAll(dependencyMap[3]).getCurrentScope().setUser(object);
updateNativeReporter(object);
}, clearUser: function() {
importAll(dependencyMap[3]).getCurrentScope().setUser(null);
updateNativeReporter();
}, setTags: setTags_13522, setExtra: setExtra_13523, captureException: captureException_13524,
captureCrash: captureCrash, captureMessage: captureMessage_13529, addFeatureFlag: addFeatureFlag,
addBreadcrumb: addBreadcrumb_13532, profiledRootComponent: function(a0) {
var r0;
var value = a0;
var ReleaseChannel = importAll(dependencyMap[6]).getConstants().ReleaseChannel;
if (ReleaseChannel !== 'canaryRelease') {
r0 = value;
} else {
value = importAll(dependencyMap[3]).withProfiler(value, {'includeRender': true, 'includeUpdates': true});
r0 = value;
}
return r0;
}, crash: function() {
var CrashReportingManager = NativeModules.CrashReportingManager;
CrashReportingManager.crash();
}, markCrashHandled: markCrashHandled, getLastCrashReport: function() {
var Promise = global.Promise;
var value = Object.create(Promise.prototype, {constructor: {value: Promise}});
var value2 = new Promise(_fun13537);
return value2 instanceof Object ? value2 : value;
}};
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/SentryUtils.native.tsx');
exports.default = object2;
}
function updateNativeReporter() { // fn#13519, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1343:211, offset: 0x00ded59e, size: 47 bytes, params: 1, frame: 12
const value = a0;
const r3 = value !== undefined ? value : {staff: false};
const CrashReportingManager = NativeModules.CrashReportingManager;
CrashReportingManager.setUser(r3);
}
function setTags_13522(a0) { // fn#13522, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1343:513, offset: 0x00ded661, size: 51 bytes, params: 2, frame: 12
let value = importAll(819) /* metro dependency 819 */;
value = value.getCurrentScope();
value.setTags(a0);
}
function setExtra_13523(a0) { // fn#13523, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1343:562, offset: 0x00ded694, size: 51 bytes, params: 2, frame: 12
let value = importAll(819) /* metro dependency 819 */;
value = value.getCurrentScope();
value.setExtras(a0);
}
function captureException_13524(a0, a1) { // fn#13524, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1343:614, offset: 0x00ded6c7, size: 86 bytes, params: 3, frame: 15
const env0_0 = a0;
const env0_1 = (require(12844) /* metro dependency 12844: ErrorCommonUtils */).getUpdatedOptions(a1);
(importAll(819) /* metro dependency 819 */).withScope(_fun13525);
}
function captureCrash(a0, a1) { // fn#13526, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1343:805, offset: 0x00ded79d, size: 169 bytes, params: 3, frame: 17
const env0_0 = a0;
const value2 = undefined;
const updatedOptions = (require(12844) /* metro dependency 12844: ErrorCommonUtils */).getUpdatedOptions(a1);
const r6 = (updatedOptions == null ? value2 : updatedOptions.tags) ?? ({});
const Object = global.Object;
const env0_3 = Object.assign({crash: 'true'}, r6);
(importAll(819) /* metro dependency 819 */).withScope(_fun13527);
return env0_1;
}
function captureMessage_13529(a0, a1) { // fn#13529, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1343:1254, offset: 0x00ded92d, size: 86 bytes, params: 3, frame: 15
const env0_0 = a0;
const env0_1 = (require(12844) /* metro dependency 12844: ErrorCommonUtils */).getUpdatedOptions(a1);
(importAll(819) /* metro dependency 819 */).withScope(_fun13530);
}
function addFeatureFlag(a0, a1) { // fn#13531, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1343:1448, offset: 0x00deda17, size: 150 bytes, params: 3, frame: 15
var r5;
var value;
const value2 = undefined;
const getClient = (importAll(819) /* metro dependency 819 */).getClient;
if (getClient == null) {
r5 = value2;
} else {
value = importAll(819) /* metro dependency 819 */;
value = value.getClient();
r5 = value;
}
const r4 = r5 == null || r5.getIntegrationByName == null ? value2 : r5.getIntegrationByName('FeatureFlags');
if (!(r4 == null || r4.addFeatureFlag == null)) {
r4.addFeatureFlag(a0, a1);
}
return value2;
}
function addBreadcrumb_13532(a0) { // fn#13532, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1343:1667, offset: 0x00dedaad, size: 57 bytes, params: 2, frame: 14
env0_5.verbose('Breadcrumb', a0);
(importDefault(818) /* metro dependency 818: addSentryBreadcrumbNative */)(a0);
}
function markCrashHandled(a0) { // fn#13535, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1343:1907, offset: 0x00dedb66, size: 95 bytes, params: 2, frame: 13
var value;
var CrashReportingManager;
var markCrashHandled;
var value2;
var error;
var binding;
if (a0.length !== 0) {
try {
value = environment;
CrashReportingManager = NativeModules.CrashReportingManager;
markCrashHandled = CrashReportingManager.markCrashHandled;
value2 = markCrashHandled == null;
if (!value2) {
CrashReportingManager = NativeModules.CrashReportingManager;
CrashReportingManager.markCrashHandled(a0);
}
} catch (error) {
binding = env0_5;
binding.warn('Failed to mark crash as handled', error);
}
}
}
function getLastCrashReport() { // fn#13536, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1343:2113, offset: 0x00dedbc5, size: 37 bytes, params: 1, frame: 11
const Promise = global.Promise;
const value = Object.create(Promise.prototype, {constructor: {value: Promise}});
const promise = new Promise(_fun13537);
return promise instanceof Object ? promise : value;
}
function _fun13525(a0) { // fn#13525, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1343:690, offset: 0x00ded71d, size: 128 bytes, params: 2, frame: 13
if (env0_1 != null) {
if (env0_1.tags != null) {
a0.setTags(env0_1.tags);
}
if (env0_1.extra != null) {
a0.setExtras(env0_1.extra);
}
}
(importAll(819) /* metro dependency 819 */).captureException(env0_0);
}
function _fun13527(a0) { // fn#13527, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1343:986, offset: 0x00ded846, size: 153 bytes, params: 2, frame: 13
if (env0_2 != null && env0_2.extra != null) {
a0.setExtras(env0_2.extra);
}
a0.setTags(env0_3);
a0.setLevel('fatal');
a0.addEventProcessor(function(a0) {
var r5;
var r2;
var object;
var property = a0.exception;
r2 = property == null || property.values == null ? undefined : property.values[0];
if (r2 != null) {
object = {};
copyDataProperties(object, r2.mechanism, r5);
object['handled'] = false;
r2.mechanism = object;
}
return a0;
});
env0_1 = (importAll(819) /* metro dependency 819 */).captureException(env0_0);
}
function _fun13530(a0) { // fn#13530, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1343:1328, offset: 0x00ded983, size: 148 bytes, params: 2, frame: 13
if (env0_1 != null && env0_1.extra != null) {
a0.setExtras(env0_1.extra);
}
if (env0_1 != null && env0_1.tags != null) {
a0.setTags(env0_1.tags);
}
(importAll(819) /* metro dependency 819 */).captureMessage(env0_0);
}
function _fun13537(a0, a1) { // fn#13537, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1343:2130, offset: 0x00dedbea, size: 77 bytes, params: 3, frame: 15
var environment;
const env0_0 = a0;
const env0_1 = a1;
let value = environment.__proto__;
const CrashReportingManager = NativeModules.CrashReportingManager;
value = undefined;
const getLastCrashReport = CrashReportingManager == null ? value : CrashReportingManager.getLastCrashReport;
if (getLastCrashReport != null) {
CrashReportingManager.getLastCrashReport(_fun13538);
} else {
a0(null);
}
return value;
}
function _fun13538(a0) { // fn#13538, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1343:2234, offset: 0x00dedc37, size: 599 bytes, params: 2, frame: 19
var r5;
var r4;
var r7;
var r3;
var r1;
var value;
var binding;
var value2;
var value3;
var timestamp;
var value4;
var value5;
var Number;
var isNaN;
var isNaN2;
var value6;
var level;
var value7;
var is_native;
var value8;
var value9;
var value10;
var value11;
var object2;
var event_id;
var value12;
var isNonEmptyStringBinding;
var origin;
var isNonEmptyString2;
var object4;
var error_message;
var isNonEmptyString3;
var error_stack;
var isNonEmptyString4;
var exit_reason;
var isNonEmptyString5;
var exit_description;
var isNonEmptyString6;
var tombstone;
var isNonEmptyString7;
var tombstone_cause;
var isNonEmptyString8;
var tombstone_hash;
var isNonEmptyString9;
var tombstone_group_by;
var isNonEmptyString10;
var tombstone_origin;
var isNonEmptyString11;
var value13;
var value14;
var Object;
var assign;
var extra;
var value15;
var error;
try {
value = environment;
binding = env0_0;
value2 = null;
value3 = value2 == a0;
if (value3) {
r1 = value2;
} else {
timestamp = a0.timestamp;
value4 = undefined;
value5 = typeof timestamp !== 'number';
if (value5) {
r5 = value4;
} else {
Number = global.Number;
isNaN = Number.isNaN;
timestamp = a0.timestamp;
isNaN2 = Reflect.apply(isNaN, Number, [timestamp]);
if (isNaN2) {
r5 = value4;
} else {
timestamp = a0.timestamp;
value6 = timestamp / 1000;
r5 = value6;
}
}
level = a0.level;
value7 = value2 != level;
if (value7) {
r7 = level;
} else {
is_native = a0.is_native;
value8 = 'error';
if (is_native) {
value9 = 'fatal';
r4 = value9;
} else {
r4 = value8;
}
r7 = r4;
}
value10 = value2 == r7;
if (value10) {
r4 = value4;
} else {
value11 = r7.toLowerCase();
r4 = value11;
}
object2 = {type: value4};
event_id = a0.event_id;
object2.event_id = event_id;
object2.timestamp = r5;
object2.level = r4;
value12 = environment.__proto__.__proto__;
isNonEmptyStringBinding = isNonEmptyString;
origin = a0.origin;
isNonEmptyString2 = isNonEmptyStringBinding(origin);
if (isNonEmptyString2) {
origin = a0.origin;
r5 = {['event.origin']: origin};
} else {
r5 = value4;
}
object2.tags = r5;
object4 = {};
isNonEmptyStringBinding = isNonEmptyString;
error_message = a0.error_message;
isNonEmptyString3 = isNonEmptyStringBinding(error_message);
if (isNonEmptyString3) {
error_message = a0.error_message;
object2.message = error_message;
error_message = a0.error_message;
object4.persisted_error_message = error_message;
}
isNonEmptyStringBinding = isNonEmptyString;
error_stack = a0.error_stack;
isNonEmptyString4 = isNonEmptyStringBinding(error_stack);
if (isNonEmptyString4) {
error_stack = a0.error_stack;
object4.persisted_error_stack = error_stack;
}
is_native = a0.is_native;
if (is_native) {
isNonEmptyStringBinding = isNonEmptyString;
exit_reason = a0.exit_reason;
isNonEmptyString5 = isNonEmptyStringBinding(exit_reason);
if (isNonEmptyString5) {
exit_reason = a0.exit_reason;
object4.native_exit_reason = exit_reason;
}
isNonEmptyStringBinding = isNonEmptyString;
exit_description = a0.exit_description;
isNonEmptyString6 = isNonEmptyStringBinding(exit_description);
if (isNonEmptyString6) {
exit_description = a0.exit_description;
object4.native_exit_description = exit_description;
}
isNonEmptyStringBinding = isNonEmptyString;
tombstone = a0.tombstone;
isNonEmptyString7 = isNonEmptyStringBinding(tombstone);
if (isNonEmptyString7) {
tombstone = a0.tombstone;
object4.native_tombstone = tombstone;
}
isNonEmptyStringBinding = isNonEmptyString;
tombstone_cause = a0.tombstone_cause;
isNonEmptyString8 = isNonEmptyStringBinding(tombstone_cause);
if (isNonEmptyString8) {
tombstone_cause = a0.tombstone_cause;
object4.native_tombstone_cause = tombstone_cause;
}
isNonEmptyStringBinding = isNonEmptyString;
tombstone_hash = a0.tombstone_hash;
isNonEmptyString9 = isNonEmptyStringBinding(tombstone_hash);
if (isNonEmptyString9) {
tombstone_hash = a0.tombstone_hash;
object4.native_tombstone_hash = tombstone_hash;
}
isNonEmptyStringBinding = isNonEmptyString;
tombstone_group_by = a0.tombstone_group_by;
isNonEmptyString10 = isNonEmptyStringBinding(tombstone_group_by);
if (isNonEmptyString10) {
tombstone_group_by = a0.tombstone_group_by;
object4.native_tombstone_group_by = tombstone_group_by;
}
isNonEmptyStringBinding = isNonEmptyString;
tombstone_origin = a0.tombstone_origin;
isNonEmptyString11 = isNonEmptyStringBinding(tombstone_origin);
if (isNonEmptyString11) {
tombstone_origin = a0.tombstone_origin;
object4.native_tombstone_origin = tombstone_origin;
}
}
is_native = a0.is_native;
value13 = 'false';
if (is_native) {
value14 = 'true';
r3 = value14;
} else {
r3 = value13;
}
object4.native_is_native = r3;
Object = global.Object;
assign = Object.assign;
extra = object2.extra;
value15 = Reflect.apply(assign, Object, [{}, extra, object4]);
object2.extra = value15;
r1 = object2;
}
binding(r1);
} catch (error) {
require(error);
}
}
+74
View File
@@ -0,0 +1,74 @@
/* Metro module 21; source: utils/SnowflakeUtils.tsx; dependencies: [22, 23, 2] */
function _fun282(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#282, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:26:6, offset: 0x00c3e633, size: 304 bytes, params: 8, frame: 18
var object2;
let Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
object2 = {age: age, extractTimestamp: extractTimestamp, compare: compare,
atPreviousMillisecond: atPreviousMillisecond, atNextMillisecond: atNextMillisecond,
fromTimestamp: fromTimestamp, fromTimestampWithSequence: fromTimestampWithSequence, keys: function(a0) {
var Object = global.Object;
return Object.keys(a0);
}, forEach: forEach, forEachKey: function(a0, a1) {
var propertyName;
for (propertyName in a0) {
a1(propertyName);
}
}, entries: function(a0) {
var Object = global.Object;
return Object.entries(a0);
}, isProbablyAValidSnowflake: isProbablyAValidSnowflake, castChannelIdAsMessageId: function(a0) {
return a0;
}, castMessageIdAsChannelId: function(a0) {
return a0;
}, castGuildIdAsEveryoneGuildRoleId: function(a0) {
return a0;
}, cast: function(a0) {
return a0;
}};
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/SnowflakeUtils.tsx');
exports.default = object2;
const DISCORD_EPOCH = (require(23) /* metro dependency 23: SnowflakeUtils */).DISCORD_EPOCH;
exports.DISCORD_EPOCH = DISCORD_EPOCH;
const SnowflakeSequence = (require(23) /* metro dependency 23: SnowflakeUtils */).SnowflakeSequence;
exports.SnowflakeSequence = SnowflakeSequence;
}
function age(a0) { // fn#284, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:26:129, offset: 0x00c3e763, size: 41 bytes, params: 2, frame: 11
return (importAll(23) /* metro dependency 23: SnowflakeUtils */).age(a0);
}
function extractTimestamp(a0) { // fn#285, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:26:185, offset: 0x00c3e78c, size: 41 bytes, params: 2, frame: 11
return (importAll(23) /* metro dependency 23: SnowflakeUtils */).extractTimestamp(a0);
}
function compare(a0, a1) { // fn#286, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:26:258, offset: 0x00c3e7b5, size: 45 bytes, params: 3, frame: 13
return (importAll(23) /* metro dependency 23: SnowflakeUtils */).compare(a0, a1);
}
function atPreviousMillisecond(a0) { // fn#287, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:26:331, offset: 0x00c3e7e2, size: 41 bytes, params: 2, frame: 11
return (importAll(23) /* metro dependency 23: SnowflakeUtils */).atPreviousMillisecond(a0);
}
function atNextMillisecond(a0) { // fn#288, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:26:424, offset: 0x00c3e80b, size: 41 bytes, params: 2, frame: 11
return (importAll(23) /* metro dependency 23: SnowflakeUtils */).atNextMillisecond(a0);
}
function fromTimestamp(a0) { // fn#289, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:26:505, offset: 0x00c3e834, size: 41 bytes, params: 2, frame: 11
return (importAll(23) /* metro dependency 23: SnowflakeUtils */).fromTimestamp(a0);
}
function fromTimestampWithSequence(a0, a1) { // fn#290, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:26:590, offset: 0x00c3e85d, size: 45 bytes, params: 3, frame: 13
return (importAll(23) /* metro dependency 23: SnowflakeUtils */).fromTimestampWithSequence(a0, a1);
}
function forEach(a0, a1) { // fn#292, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:26:730, offset: 0x00c3e8a1, size: 54 bytes, params: 3, frame: 14
const env0_0 = a1;
(importDefault(22) /* metro dependency 22 */).forEach(a0, function(a0, a1) {
return require(a0, a1);
});
}
function isProbablyAValidSnowflake(a0) { // fn#296, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:26:925, offset: 0x00c3e92b, size: 41 bytes, params: 2, frame: 11
return (importAll(23) /* metro dependency 23: SnowflakeUtils */).isProbablyAValidSnowflake(a0);
}
+46
View File
@@ -0,0 +1,46 @@
/* Metro module 4818; source: utils/SortedArrayUtils.tsx; dependencies: [2] */
function _fun42031(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#42031, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4996:6, offset: 0x0112e62c, size: 102 bytes, params: 8, frame: 17
const closure = function(a0, a1, a2) {
var r1;
var r5;
var r9;
var r0;
var value2;
var value3;
var length = a0.length;
var value = 0;
if (value < length) {
r1 = value;
r5 = length;
while (true) {
value2 = r1 + r5 >>> 1;
if (a2(a0[value2], a1) < value) {
value3 = value2 + 1;
r1 = value3;
r9 = r5;
} else {
r9 = value2;
}
if (r1 < r9) {
r5 = r9;
continue;
}
r0 = r1;
break;
}
} else {
r0 = value;
}
return r0;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/SortedArrayUtils.tsx');
exports.insertionIndex = closure;
exports.insert = insert;
}
function insert(a0, a1, a2) { // fn#42033, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4996:298, offset: 0x0112e6de, size: 42 bytes, params: 4, frame: 16
a0.splice(insertionIndex(a0, a1, a2), 0, a1);
}
+220
View File
@@ -0,0 +1,220 @@
/* Metro module 6726; source: utils/SpellcheckUtils.tsx; dependencies: [5, 3767, 477, 6727, 2] */
function _fun52801(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#52801, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6904:6, offset: 0x01337af8, size: 315 bytes, params: 8, frame: 20
const env0_0 = require;
const isElectronBuiltInSpellcheckerSupported = function() {
return importDefault(dependencyMap[1])?.spellCheck != null;
};
const closure = isSupported_52803;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
let value = closure();
if (value) {
value = require(6727) /* metro dependency 6727: Spellchecker */;
value = value.install();
}
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/SpellcheckUtils.tsx');
exports.isSupported = closure;
exports.setEnabled = function() {
return _setEnabled.apply(this, arguments);
};
exports.setLearnedWords = function() {
return _setLearnedWords.apply(this, arguments);
};
exports.isMisspelled = function() {
return _isMisspelled.apply(this, arguments);
};
exports.getCorrections = function() {
return _getCorrections.apply(this, arguments);
};
exports.getCachedMisspelling = function() {
return _getCachedMisspelling.apply(this, arguments);
};
exports.replaceWithCorrection = function() {
return _replaceWithCorrection.apply(this, arguments);
};
exports.setAppLocale = function() {
return _setAppLocale_52822.apply(this, arguments);
};
exports.addResultListener = addResultListener;
}
function isSupported_52803() { // fn#52803, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6904:211, offset: 0x01337c74, size: 48 bytes, params: 1, frame: 12
return (require(477) /* metro dependency 477: PlatformUtils */).isDesktop() && isElectronBuiltInSpellcheckerSupported();
}
function _setEnabled() { // fn#52804, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6904:346, offset: 0x01337ca4, size: 48 bytes, params: 1, frame: 14
return env0_3(_fun52806).apply(this, arguments);
}
function _setLearnedWords() { // fn#52807, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6904:467, offset: 0x01337d0f, size: 48 bytes, params: 1, frame: 14
return env0_3(_fun52809).apply(this, arguments);
}
function _isMisspelled() { // fn#52810, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6904:605, offset: 0x01337d7f, size: 48 bytes, params: 1, frame: 14
return env0_3(_fun52812).apply(this, arguments);
}
function _getCorrections() { // fn#52813, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6904:748, offset: 0x01337e12, size: 48 bytes, params: 1, frame: 14
return env0_3(_fun52815).apply(this, arguments);
}
function _getCachedMisspelling() { // fn#52816, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6904:928, offset: 0x01337ec1, size: 48 bytes, params: 1, frame: 14
return env0_3(_fun52818).apply(this, arguments);
}
function _replaceWithCorrection() { // fn#52819, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6904:1208, offset: 0x01337f89, size: 48 bytes, params: 1, frame: 14
return env0_3(_fun52821).apply(this, arguments);
}
function _setAppLocale_52822() { // fn#52822, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6904:1361, offset: 0x01337ff9, size: 48 bytes, params: 1, frame: 14
return env0_3(_fun52824).apply(this, arguments);
}
function addResultListener(a0) { // fn#52832, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6904:2236, offset: 0x01338069, size: 85 bytes, params: 2, frame: 14
if (isElectronBuiltInSpellcheckerSupported()) {
return (importDefault(3767) /* metro dependency 3767: DiscordNative */).spellCheck.on('spellcheck-result',
a0) ?? (function() {
});
}
return function() {
};
}
function* _fun52806(a0) { // fn#52806, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6904:391, offset: 0x01337cdd, size: 50 bytes, params: 2, frame: 3
if (true) {
value = environment.__proto__.__proto__;
yield env2_4;
value = undefined;
if (false) {
return value;
}
if (value != null) {
value.enabled = a0;
}
}
}
function* _fun52809(a0) { // fn#52809, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6904:522, offset: 0x01337d48, size: 55 bytes, params: 2, frame: 12
if (true) {
value = environment.__proto__.__proto__;
yield env2_4;
value = undefined;
if (false) {
return value;
}
if (value != null) {
value.setLearnedWords(a0);
}
}
}
async function _fun52812(a0) { // fn#52812, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6904:654, offset: 0x01337dc1, size: 81 bytes, params: 2, frame: 16
var r3;
let value = a1;
if (false) {
return undefined;
}
const r6 = value !== undefined ? value : false;
await undefined;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
await env2_4;
value = undefined;
if (false) {
return value;
}
const value6 = value != null;
if (value6) {
value = value.isMisspelled(a0, r6);
r3 = value;
} else {
r3 = value6;
}
return r3;
}
async function _fun52815(a0) { // fn#52815, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6904:801, offset: 0x01337e54, size: 109 bytes, params: 2, frame: 16
var r3;
let value = a1;
const value2 = a2;
if (false) {
return undefined;
}
const r5 = value !== undefined ? value : false;
const r6 = value2 !== undefined ? value2 : 5;
await undefined;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
await env2_4;
if (false) {
return undefined;
}
if (value == null) {
r3 = [];
} else {
value = value.getCorrectionsForMisspelling(a0, r5);
value = value.slice(0, r6);
r3 = value;
}
return r3;
}
async function _fun52818() { // fn#52818, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6904:993, offset: 0x01337f03, size: 134 bytes, params: 1, frame: 17
let value = a0;
if (false) {
return undefined;
}
const r7 = value !== undefined ? value : 5;
await undefined;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
await env2_4;
value = undefined;
if (false) {
return value;
}
if (value == null) {
return {misspelledWord: '', corrections: []};
}
value = value.getCachedMisspelling();
const object2 = {};
object2.misspelledWord = value.misspelledWord;
object2.corrections = value.corrections.slice(0, r7);
return object2;
}
function* _fun52821(a0) { // fn#52821, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6904:1275, offset: 0x01337fc2, size: 55 bytes, params: 2, frame: 12
if (true) {
value = environment.__proto__.__proto__;
yield env2_4;
value = undefined;
if (false) {
return value;
}
if (value != null) {
value.replaceMisspelling(a0);
}
}
}
function* _fun52824(a0) { // fn#52824, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6904:1410, offset: 0x01338032, size: 55 bytes, params: 2, frame: 12
if (true) {
value = environment.__proto__.__proto__;
yield env2_4;
value = undefined;
if (false) {
return value;
}
if (value != null) {
value.setAppLocale(a0);
}
}
}
+407
View File
@@ -0,0 +1,407 @@
/* Metro module 4141; source: utils/StoreUtils.tsx; dependencies: [5, 1226, 3804, 3805, 3808, 661, 4142, 4140, 4221, 1457, 4223, 507, 477, 1244, 2] */
function _fun34359(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#34359, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4312:6, offset: 0x010541d4, size: 374 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(5) /* metro dependency 5 */;
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
const billingInfoStore = importDefault(3804) /* metro dependency 3804: BillingInfoStore */;
const paymentSourceStore = importDefault(3805) /* metro dependency 3805: PaymentSourceStore */;
const subscriptionStore = importDefault(3808) /* metro dependency 3808: SubscriptionStore */;
let value = require(661) /* metro dependency 661: Constants */;
const env0_7 = value.Endpoints;
const env0_8 = value.OperatingSystems;
(importDefault(4142) /* metro dependency 4142 */).shim();
let r3 = !(require(4140) /* metro dependency 4140: PlatformUtils */).isMobile && !(require(4140) /* metro dependency 4140: PlatformUtils */).isTablet;
if (r3) {
value = require(4221) /* metro dependency 4221: BrowserUtils */;
value = value.getChromeVersion();
value = value !== -1;
r3 = value;
}
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/StoreUtils.tsx');
exports.SUPPORTS_WEBP = r3;
exports.getAssetURL = getAssetURL;
exports.httpGetWithCountryCodeQuery = function() {
return _httpGetWithCountryCodeQuery.apply(this, arguments);
};
exports.nativePlatformTypeToSKUOperatingSystem = nativePlatformTypeToSKUOperatingSystem;
exports.skuOperatingSystemToText = skuOperatingSystemToText;
exports.getPrimarySKUForApplication = function(a0, a1, a2) {
var r0;
var value = a1.getApplication(a0);
var value2 = null;
if (value2 == value) {
r0 = value2;
} else if (value2 == value.primarySkuId) {
r0 = value2;
} else {
value = a2.get(value.primarySkuId);
r0 = value;
}
return r0;
};
}
function _httpGetWithCountryCodeQuery() { // fn#34360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4312:282, offset: 0x0105434a, size: 48 bytes, params: 1, frame: 14
return env0_2(_fun34362).apply(this, arguments);
}
function getAssetURL(a0, a1, a2, a3) { // fn#34371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4312:1701, offset: 0x0105476f, size: 374 bytes, params: 5, frame: 31
var r0;
var API_ENDPOINT;
var getBestMediaProxySize;
var moduleValue;
let value = a1;
const value2 = a3;
const GLOBAL_ENV = global.window.GLOBAL_ENV;
const CDN_HOST = GLOBAL_ENV.CDN_HOST;
let r13 = value2 ?? ((value.mimeType || value.mime_type) === 'video/quicktime' || (value.mimeType || value.mime_type) === 'video/mp4' ? 'mp4' : (value.mimeType || value.mime_type) === 'image/gif' ? 'gif' : 'webp');
let r2 = r13 !== 'webp' || env0_9;
r13 = !r2 ? 'png' : r13;
const r11 = typeof value === 'string' ? value : value.id;
if (CDN_HOST != null) {
r2 = '' + 'https:' + '//' + CDN_HOST + '/app-assets/' + a0 + '/store/' + r11 + '.' + r13;
} else {
API_ENDPOINT = global.window.GLOBAL_ENV.API_ENDPOINT;
value = Endpoints.STORE_ASSET(a0, r11, r13);
value = '' + 'https:' + API_ENDPOINT + value;
r2 = value;
}
if (a2 == null) {
r0 = r2;
} else {
value = require(1457) /* metro dependency 1457: ImageLoaderUtils */;
getBestMediaProxySize = value.getBestMediaProxySize;
moduleValue = require(1457) /* metro dependency 1457: ImageLoaderUtils */;
value = Reflect.apply(getBestMediaProxySize, value, [a2 * moduleValue.getDevicePixelRatio()]);
value = r2 + ('?size=' + value);
r0 = value;
}
return r0;
}
function nativePlatformTypeToSKUOperatingSystem(a0) { // fn#34373, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4312:2394, offset: 0x010548e5, size: 150 bytes, params: 2, frame: 14
const PlatformTypes = (require(477) /* metro dependency 477: PlatformUtils */).PlatformTypes;
const WINDOWS = PlatformTypes.WINDOWS;
if (WINDOWS === a0) {
return OperatingSystems.WINDOWS;
}
const OSX = PlatformTypes.OSX;
if (OSX === a0) {
return OperatingSystems.MACOS;
}
const LINUX = PlatformTypes.LINUX;
if (LINUX === a0) {
return OperatingSystems.LINUX;
}
return null;
}
function skuOperatingSystemToText(a0) { // fn#34374, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4312:2653, offset: 0x0105497b, size: 289 bytes, params: 2, frame: 15
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const WINDOWS = OperatingSystems.WINDOWS;
if (WINDOWS === a0) {
return intl.string(t['0/xHFO']);
}
const MACOS = OperatingSystems.MACOS;
if (MACOS === a0) {
return intl.string(t.E4u4n5);
}
const LINUX = OperatingSystems.LINUX;
if (LINUX === a0) {
return intl.string(t.tcawo3);
}
const Error = global.Error;
const value = 'Unknown operating system value: ' + a0;
const value2 = Object.create(Error.prototype, {constructor: {value: Error}});
const error = new Error();
throw error instanceof Object ? error : value2;
}
async function _fun34362(a0) { // fn#34362, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4312:361, offset: 0x0105438c, size: 628 bytes, params: 2, frame: 21
var r11;
var id;
var r5;
var object;
var push;
var value11;
var Promise;
var race;
var items2;
var Promise3;
var value13;
var promise;
var defaultBillingCountryCode;
var defaultPaymentSource;
var value18;
var premiumTypeSubscription;
var ipCountryCode;
var value22;
var query;
var object2;
let value = a0;
let value2 = a1;
if (false) {
return undefined;
}
const value5 = undefined;
let r4 = !(value2 !== value5) || value2;
await value5;
if (false) {
return undefined;
}
let binding = env2_3;
if (r4) {
if (binding.isAuthenticated()) {
object = [];
if (!env2_5.hasFetchedPaymentSources) {
object.push(env2_4.paymentSourcesFetchRequest ?? env2_0(env2_1[10]).fetchPaymentSources());
}
if (!env2_4.ipCountryCodeLoaded) {
push = object.push;
value11 = env2_0(env2_1[10]);
Reflect.apply(push, object, [value11.fetchIpCountryCode()]);
}
object.push((() => {
var Promise = global.Promise;
var value = _fun34364();
var value2 = Object.create(Promise.prototype, {constructor: {value: Promise}});
value = new Promise(value);
return value instanceof Object ? value : value2;
})());
Promise = global.Promise;
race = Promise.race;
items2 = [global.Promise.allSettled(object)];
Promise3 = global.Promise;
value13 = Object.create(Promise3.prototype, {constructor: {value: Promise3}});
promise = new Promise3(function(a0) {
return (0, global.setTimeout)(a0, 10000);
});
items2[1] = promise instanceof Object ? promise : value13;
await Reflect.apply(race, Promise, [items2]);
if (false) {
return undefined;
}
r11 = object;
binding = env2_5;
defaultBillingCountryCode = binding.getDefaultBillingCountryCode();
defaultPaymentSource = env2_5.defaultPaymentSource;
value18 = null;
id = value18 == defaultPaymentSource ? value5 : defaultPaymentSource.id;
r4 = value18 != id ? id : value18;
binding = env2_6;
premiumTypeSubscription = binding.getPremiumTypeSubscription();
r4 = value18 != premiumTypeSubscription && value18 != premiumTypeSubscription.paymentSourceId ? premiumTypeSubscription.paymentSourceId : r4;
if (value18 !== defaultBillingCountryCode) {
r5 = defaultBillingCountryCode;
} else {
ipCountryCode = env2_4.ipCountryCode;
value22 = value18 != ipCountryCode;
r5 = value22 ? ipCountryCode : value18;
r11 = value22;
}
object = {};
if (value18 != r5) {
object.country_code = r5;
}
if (value18 != r4) {
object.payment_source_id = r4;
}
if (value18 != r5) {
r4 = typeof value !== 'string' ? value : {'url': null, 'oldFormErrors': true, 'rejectWithError': false,
url: value};
query = r4.query;
if (typeof query === 'string') {
throw new global.Error('string query not supported');
}
object2 = {};
copyDataProperties(object2, object, r11);
query = r4.query;
copyDataProperties(object2, query, r11);
r4.query = object2;
return env2_0(env2_1[11]).HTTP.get(r4);
}
if (value18 == r4) {
return env2_0(env2_1[11]).HTTP.get(value);
}
r4 = typeof value !== 'string' ? value : {'url': null, 'oldFormErrors': true, 'rejectWithError': false,
url: value};
query = r4.query;
if (typeof query === 'string') {
throw new global.Error('string query not supported');
}
object2 = {};
copyDataProperties(object2, object, r11);
query = r4.query;
copyDataProperties(object2, query, r11);
r4.query = object2;
r5 = r4;
binding = env2_0;
return binding(env2_1[11]).HTTP.get(r5);
}
binding = env2_5;
defaultBillingCountryCode = binding.getDefaultBillingCountryCode();
defaultPaymentSource = env2_5.defaultPaymentSource;
value18 = null;
id = value18 == defaultPaymentSource ? value5 : defaultPaymentSource.id;
r4 = value18 != id ? id : value18;
binding = env2_6;
premiumTypeSubscription = binding.getPremiumTypeSubscription();
r4 = value18 != premiumTypeSubscription && value18 != premiumTypeSubscription.paymentSourceId ? premiumTypeSubscription.paymentSourceId : r4;
if (value18 !== defaultBillingCountryCode) {
r5 = defaultBillingCountryCode;
} else {
ipCountryCode = env2_4.ipCountryCode;
value22 = value18 != ipCountryCode;
r5 = value22 ? ipCountryCode : value18;
r11 = value22;
}
object = {};
if (value18 != r5) {
object.country_code = r5;
}
if (value18 != r4) {
object.payment_source_id = r4;
}
if (value18 != r5) {
r4 = typeof value !== 'string' ? value : {'url': null, 'oldFormErrors': true, 'rejectWithError': false,
url: value};
query = r4.query;
if (typeof query === 'string') {
throw new global.Error('string query not supported');
}
object2 = {};
copyDataProperties(object2, object, r11);
query = r4.query;
copyDataProperties(object2, query, r11);
r4.query = object2;
return env2_0(env2_1[11]).HTTP.get(r4);
}
if (value18 == r4) {
return env2_0(env2_1[11]).HTTP.get(value);
}
r4 = typeof value !== 'string' ? value : {'url': null, 'oldFormErrors': true, 'rejectWithError': false,
url: value};
query = r4.query;
if (typeof query === 'string') {
throw new global.Error('string query not supported');
}
object2 = {};
copyDataProperties(object2, object, r11);
query = r4.query;
copyDataProperties(object2, query, r11);
r4.query = object2;
r5 = r4;
binding = env2_0;
return binding(env2_1[11]).HTTP.get(r5);
}
defaultBillingCountryCode = env2_5.getDefaultBillingCountryCode();
defaultPaymentSource = env2_5.defaultPaymentSource;
value18 = null;
id = value18 == defaultPaymentSource ? value5 : defaultPaymentSource.id;
r4 = value18 != id ? id : value18;
premiumTypeSubscription = env2_6.getPremiumTypeSubscription();
r4 = value18 != premiumTypeSubscription && value18 != premiumTypeSubscription.paymentSourceId ? premiumTypeSubscription.paymentSourceId : r4;
if (value18 !== defaultBillingCountryCode) {
r5 = defaultBillingCountryCode;
} else {
ipCountryCode = env2_4.ipCountryCode;
value22 = value18 != ipCountryCode;
r5 = value22 ? ipCountryCode : value18;
r11 = value22;
}
object = {};
if (value18 != r5) {
object.country_code = r5;
}
if (value18 != r4) {
object.payment_source_id = r4;
}
if (value18 != r5) {
r4 = typeof value !== 'string' ? value : {'url': null, 'oldFormErrors': true, 'rejectWithError': false,
url: value};
query = r4.query;
if (typeof query === 'string') {
throw new global.Error('string query not supported');
}
object2 = {};
copyDataProperties(object2, object, r11);
query = r4.query;
copyDataProperties(object2, query, r11);
r4.query = object2;
return env2_0(env2_1[11]).HTTP.get(r4);
}
if (value18 == r4) {
return env2_0(env2_1[11]).HTTP.get(value);
}
r4 = typeof value !== 'string' ? value : {'url': null, 'oldFormErrors': true, 'rejectWithError': false, url: value};
if (typeof r4.query === 'string') {
throw new global.Error('string query not supported');
}
object2 = {};
copyDataProperties(object2, object, r11);
copyDataProperties(object2, r4.query, r11);
r4.query = object2;
r5 = r4;
const HTTP = env2_0(env2_1[11]).HTTP;
return HTTP.get(r5);
}
function waitForSubscriptionsToBeFetched() { // fn#34363, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4312:608, offset: 0x01054600, size: 43 bytes, params: 1, frame: 11
const Promise = global.Promise;
const value = _fun34364();
const value2 = Object.create(Promise.prototype, {constructor: {value: Promise}});
const promise = new Promise(value);
return promise instanceof Object ? promise : value2;
}
function _fun34364() { // fn#34364, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4312:670, offset: 0x0105462b, size: 32 bytes, params: 1, frame: 12
const env0_0 = env4_2(_fun34365);
return _fun34369;
}
function* _fun34365(a0) { // fn#34365, offset: 0x0105464b, size: 18 bytes, params: 2, frame: 2
return _fun34366;
}
function* _fun34366(a0) { // fn#34366, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4312:690, offset: 0x0105465d, size: 131 bytes, params: 2, frame: 14
var environment;
if (true) {
var env0_0 = a0;
var closure = wait_34367;
value = environment.__proto__.__proto__.__proto__.__proto__.__proto__.__proto__;
var binding = env6_6;
if (!binding.hasFetchedSubscriptions()) {
if (env6_4.isSubscriptionFetching) {
closure();
return undefined;
}
value = env6_0(env6_1[10]);
yield value.fetchSubscriptions();
value = undefined;
if (false) {
return value;
}
}
a0();
}
}
function wait() { // fn#34368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4312:772, offset: 0x0105471a, size: 58 bytes, params: 1, frame: 13
if (env6_4.isSubscriptionFetching) {
global.setTimeout(wait, 50);
} else {
env6_2();
}
}
function wait_34367() { // fn#34367, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4312:772, offset: 0x010546e0, size: 58 bytes, params: 1, frame: 13
if (env7_4.isSubscriptionFetching) {
global.setTimeout(wait_34367, 50);
} else {
env0_0();
}
}
+179
View File
@@ -0,0 +1,179 @@
/* Metro module 8912; source: utils/StreamQualityUtils.tsx; dependencies: [31, 4399, 1226, 1867, 4294, 1878, 661, 4282, 1880, 4291, 1244, 566, 683, 2] */
function _fun69523(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#69523, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9097:6, offset: 0x01c75b26, size: 449 bytes, params: 8, frame: 22
let env0_0 = require;
const closure = function(a0) {
return a0.quality != null || a0.guildPremiumTier != null;
};
const closure2 = function(a0, a1, a2) {
var env0_0 = a0;
var env0_1 = a1;
var env0_2 = a2;
return ApplicationStreamSettingRequirements.find(_fun69526);
};
const closure3 = function(a0) {
var value = null;
return value == a0.maxResolution || value == a0.maxFrameRate ? value : {maxFrameRate: a0.maxFrameRate,
maxResolution: a0.maxResolution};
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const applicationStreamingSettingsStore = importDefault(4399) /* metro dependency 4399: ApplicationStreamingSettingsStore */;
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
const rtcConnectionStore = importDefault(4294) /* metro dependency 4294: RTCConnectionStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const env0_9 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
const streamSettingsConstantsModule = require(4282) /* metro dependency 4282: StreamSettingsConstants */;
const env0_10 = streamSettingsConstantsModule.ApplicationStreamFPS;
const env0_11 = streamSettingsConstantsModule.ApplicationStreamResolutions;
const env0_12 = streamSettingsConstantsModule.ApplicationStreamSettingRequirements;
const env0_13 = streamSettingsConstantsModule.getApplicationFramerate;
const env0_14 = streamSettingsConstantsModule.getApplicationResolution;
const env0_15 = (require(1880) /* metro dependency 1880: PremiumConstants */).StreamQualitiesToPremiumType;
const env0_16 = (require(4291) /* metro dependency 4291: Constants */).ResolutionTypes;
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/StreamQualityUtils.tsx');
exports.isPremiumResolution = isPremiumResolution;
exports.isPremiumFPS = isPremiumFPS;
exports.isPremiumRequirement = closure;
exports.getPremiumRequirement = closure2;
exports.getResolutionText = getResolutionText;
exports.getFPSText = function(a0) {
var intl = require(dependencyMap[10]).intl;
var Qb44XH = require(dependencyMap[10]).t.Qb44XH;
return intl.formatToPlainString(Qb44XH, {fps: a0});
};
exports.getMaxQuality = closure3;
exports.useMaxQuality = useMaxQuality;
exports.trackStreamSettingsUpdate = trackStreamSettingsUpdate;
}
function getPremiumRequirement(a0, a1, a2) { // fn#69525, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9097:499, offset: 0x01c75d05, size: 50 bytes, params: 4, frame: 11
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
return ApplicationStreamSettingRequirements.find(_fun69526);
}
function isPremiumResolution(a0) { // fn#69528, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9097:845, offset: 0x01c75dc4, size: 141 bytes, params: 2, frame: 15
if (a0 != null) {
var env0_0 = getApplicationResolution(a0.maxResolution.type === ResolutionTypes.SOURCE ? ApplicationStreamResolutions.RESOLUTION_SOURCE : a0.maxResolution.height);
return getApplicationFramerate(a0.maxFrameRate) !== ApplicationStreamFPS.FPS_5 && ApplicationStreamSettingRequirements.find(_fun69529) == null;
}
}
function isPremiumFPS(a0) { // fn#69530, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9097:1109, offset: 0x01c75e95, size: 67 bytes, params: 2, frame: 14
if (a0 != null) {
var env0_0 = getApplicationFramerate(a0.maxFrameRate);
return ApplicationStreamSettingRequirements.find(_fun69531) == null;
}
}
function getResolutionText(a0) { // fn#69532, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9097:1344, offset: 0x01c75f02, size: 156 bytes, params: 2, frame: 17
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const type = a0.type;
const SOURCE = ResolutionTypes.SOURCE;
return type === SOURCE ? intl.string(t.XjXqzh) : intl.formatToPlainString(t.TEOC0I, {resolution: a0.height});
}
function useMaxQuality(a0) { // fn#69534, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9097:1672, offset: 0x01c75fe9, size: 152 bytes, params: 2, frame: 20
const env0_0 = a0;
return env0_3.useMemo(_fun69537,
[(require(566) /* metro dependency 566: flux */).useStateFromStores([AuthenticationStore], function() {
return AuthenticationStore.getId();
}), a0,
(require(566) /* metro dependency 566: flux */).useStateFromStoresObject([ApplicationStreamingSettingsStore],
function() {
return ApplicationStreamingSettingsStore.getState();
})]);
}
function trackStreamSettingsUpdate(a0, a1, a2, a3) { // fn#69538, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9097:2011, offset: 0x01c7612b, size: 263 bytes, params: 5, frame: 25
const getPremiumRequirementBinding = getPremiumRequirement;
const value2 = undefined;
const premiumRequirementBinding = getPremiumRequirementBinding(a0, a1, a2);
const currentUser = UserStore.getCurrentUser();
const guildId = RTCConnectionStore.getGuildId();
const value6 = null;
const r12 = value6 != guildId ? GuildStore.getGuild(guildId) : value6;
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const STREAM_SETTINGS_UPDATE = AnalyticEvents.STREAM_SETTINGS_UPDATE;
Reflect.apply(track, defaultImport, [STREAM_SETTINGS_UPDATE,
{user_premium_tier: value6 == currentUser ? value2 : currentUser.premiumType,
guild_premium_tier: value6 == r12 ? value2 : r12.premiumTier,
stream_quality_user_premium_tier: value6 != (value6 == premiumRequirementBinding ? value2 : premiumRequirementBinding.quality) ? StreamQualitiesToPremiumType[premiumRequirementBinding.quality] : value6,
stream_quality_guild_premium_tier: value6 == premiumRequirementBinding ? value2 : premiumRequirementBinding.guildPremiumTier,
stream_quality_preset: a0, stream_quality_resolution: a1, stream_quality_frame_rate: a2,
soundshare_enabled: a3}]);
return value2;
}
function _fun69526(a0) { // fn#69526, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9097:552, offset: 0x01c75d37, size: 77 bytes, params: 2, frame: 4
return (a0.preset == null || a0.preset === env0_0) && a0.resolution === require && a0.fps === importDefault;
}
function _fun69529(a0) { // fn#69529, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9097:1027, offset: 0x01c75e51, size: 68 bytes, params: 2, frame: 12
var r0;
var fps;
const resolution = a0.resolution;
let value = resolution === env0_0;
if (value) {
fps = a0.fps;
value = environment.__proto__;
value = fps !== ApplicationStreamFPS.FPS_5;
r0 = value;
} else {
r0 = value;
}
if (r0) {
value = environment.__proto__;
value = !isPremiumRequirement(a0);
r0 = value;
}
return r0;
}
function _fun69531(a0) { // fn#69531, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9097:1191, offset: 0x01c75ed8, size: 42 bytes, params: 2, frame: 12
var r0;
const fps = a0.fps;
let value = fps === env0_0;
if (value) {
value = environment.__proto__;
value = !isPremiumRequirement(a0);
r0 = value;
} else {
r0 = value;
}
return r0;
}
function _fun69537() { // fn#69537, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9097:1833, offset: 0x01c760a7, size: 132 bytes, params: 1, frame: 14
var r0;
var value2;
var object3;
var binding;
var object4;
var resolution;
const idBinding = id;
const user = env0_0.user;
if (idBinding === user.id) {
object3 = {};
binding = env0_1;
object3.maxFrameRate = binding.fps;
object4 = {};
resolution = binding.resolution;
object4.height = resolution;
object4.width = 0;
resolution = binding.resolution;
object4.type = resolution === 0 ? ResolutionTypes.SOURCE : ResolutionTypes.FIXED;
object3.maxResolution = object4;
r0 = object3;
} else {
value2 = environment.__proto__;
r0 = getMaxQuality(env0_0);
}
return r0;
}
+17
View File
@@ -0,0 +1,17 @@
/* Metro module 1861; source: utils/StringUtils.tsx; dependencies: [2, 1862] */
function _fun20035(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#20035, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1988:6, offset: 0x00ebd17c, size: 214 bytes, params: 8, frame: 17
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/StringUtils.tsx');
exports.isNullOrEmpty = function(a0) {
return a0 == null || a0.length === 0;
};
exports.upperCaseFirstChar = (require(1862) /* metro dependency 1862: StringUtils */).upperCaseFirstChar;
const getAcronym = (require(1862) /* metro dependency 1862: StringUtils */).getAcronym;
exports.getAcronym = getAcronym;
exports.cssValueToNumber = (require(1862) /* metro dependency 1862: StringUtils */).cssValueToNumber;
exports.stripDiacritics = (require(1862) /* metro dependency 1862: StringUtils */).stripDiacritics;
exports.truncateText = (require(1862) /* metro dependency 1862: StringUtils */).truncateText;
exports.normalize = (require(1862) /* metro dependency 1862: StringUtils */).normalize;
}
+891
View File
@@ -0,0 +1,891 @@
/* Metro module 4229; source: utils/StripeUtils.tsx; dependencies: [5, 57, 1949, 661, 3, 4230, 507, 566, 2] */
function _fun34900(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#34900, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4400:6, offset: 0x010654fc, size: 414 bytes, params: 8, frame: 21
const env0_0 = require;
const closure = getStripe;
const closure2 = getStripeElementLocale;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
const env0_4 = importDefault(57) /* metro dependency 57 */;
const localeStore = importDefault(1949) /* metro dependency 1949: LocaleStore */;
let value = require(661) /* metro dependency 661: Constants */;
const env0_6 = value.Endpoints;
const env0_7 = value.PaymentSettings;
value = importDefault(3) /* metro dependency 3: Logger */;
value = new value('StripeUtils');
object = {REQUIRES_PAYMENT_METHOD: 'requires_payment_method', REQUIRES_CONFIRMATION: 'requires_confirmation',
REQUIRES_ACTION: 'requires_action', PROCESSING: 'processing', CANCELED: 'canceled', SUCCEEDED: 'succeeded'};
const env0_10 = {'en-US': 'en', 'zh-CN': 'zh', 'sv-SE': 'sv'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/StripeUtils.tsx');
exports.validateExpiry = validateExpiry;
exports.getStripe = closure;
exports.getStripeClientMode = getStripeClientMode;
exports.parseStripePaymentMethod = parseStripePaymentMethod;
exports.parseBillingAddressInfoToStripeBillingDetails = function(a0) {
return {name: a0.name, address: {line1: a0.line1, line2: a0.line2, city: a0.city, state: a0.state,
postal_code: a0.postalCode, country: a0.country}};
};
exports.authenticatePaymentIntentForPaymentId = function() {
return _authenticatePaymentIntentForPaymentId.apply(this, arguments);
};
exports.getStripeElementLocale = closure2;
exports.useStripeLocale = function() {
return require(dependencyMap[7]).useStateFromStores([LocaleStore], _fun34916);
};
}
function getStripe() { // fn#34901, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4400:443, offset: 0x0106569a, size: 105 bytes, params: 1, frame: 12
var r0;
var moduleValue;
var value;
if (env0_2 != null) {
r0 = global.Promise.resolve(env0_2);
} else {
moduleValue = require(4230) /* metro dependency 4230 */;
value = moduleValue.loadStripe(PaymentSettings.STRIPE.KEY);
value = value.then(function(a0) {
env1_2 = a0;
return a0;
});
r0 = value;
}
return r0;
}
function _authenticatePaymentIntentForPaymentId() { // fn#34903, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4400:550, offset: 0x0106570f, size: 48 bytes, params: 1, frame: 14
return env0_3(_fun34905).apply(this, arguments);
}
function getStripeElementLocale(a0) { // fn#34906, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4400:1638, offset: 0x0106598a, size: 25 bytes, params: 2, frame: 3
const value = a0;
return env0_10[value] ?? value;
}
function validateExpiry(a0) { // fn#34907, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4400:1778, offset: 0x010659a3, size: 176 bytes, params: 2, frame: 15
var environment;
var closure;
var value;
var value2;
var binding;
var property;
var property2;
var error;
try {
closure = parseExpString;
value = closure(a0);
value2 = environment;
binding = env0_4;
value = binding(value, 2);
property = value[0];
property2 = value[1];
} catch (error) {
return false;
}
let Date = global.Date;
let date = new Date();
Date = global.Date;
date = new Date();
let setMonth = date.setMonth;
let getMonth = date.getMonth;
Reflect.apply(setMonth, date, [Reflect.apply(getMonth, date, []) - 1]);
setMonth = date.setMonth;
getMonth = date.getMonth;
Reflect.apply(setMonth, date, [Reflect.apply(getMonth, date, []) + 1, 1]);
return date > date;
}
function getStripeClientMode() { // fn#34911, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4400:2545, offset: 0x01065bfb, size: 197 bytes, params: 1, frame: 16
var r2;
var r0;
var binding;
const STRIPE = PaymentSettings.STRIPE;
const KEY = STRIPE.KEY;
if (KEY == null) {
binding = env0_8;
binding.warn('getStripeClientMode() called before PaymentSettings.STRIPE.KEY initialized: ',
PaymentSettings.STRIPE.KEY);
r0 = 'unknown';
} else if (PaymentSettings.STRIPE.KEY.startsWith('pk_live')) {
r0 = 'live';
} else {
if (PaymentSettings.STRIPE.KEY.startsWith('pk_test')) {
r2 = 'test';
} else {
binding = env0_8;
binding.warn('Unexpected value for Stripe public key: ', PaymentSettings.STRIPE.KEY);
r2 = 'unknown';
}
r0 = r2;
}
return r0;
}
function parseStripePaymentMethod({billing_details, id}) { // fn#34912, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4400:2903, offset: 0x01065cc0, size: 209 bytes, params: 2, frame: 8
const r3 = billing_details.address ?? ({});
const name = billing_details.name;
const value = '';
return {token: id, billingAddressInfo: {name: name ?? value, line1: r3.line1 ?? value, line2: r3.line2 ?? value,
city: r3.city ?? value, state: r3.state ?? value, country: r3.country ?? value,
postalCode: r3.postal_code ?? value}};
}
function useStripeLocale() { // fn#34915, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4400:3728, offset: 0x01065de8, size: 57 bytes, params: 1, frame: 13
return (require(566) /* metro dependency 566: flux */).useStateFromStores([LocaleStore], function() {
return getStripeElementLocale(LocaleStore.locale);
});
}
function* _fun34905(a0) { // fn#34905, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4400:649, offset: 0x01065748, size: 578 bytes, params: 2, frame: 25
var r13;
var r12;
var r6;
var binding;
var binding2;
var property;
var value3;
var HTTP;
var get;
var object2;
var BILLING_STRIPE_PAYMENT_INTENTS;
var value4;
var value5;
var value6;
var value7;
var body;
var stripe_payment_intent_client_secret;
var value8;
var value9;
var value10;
var value11;
var retrievePaymentIntent;
var value12;
var value13;
var value14;
var error;
var paymentIntent;
var value15;
var value16;
var status;
var REQUIRES_PAYMENT_METHOD;
var last_payment_error;
var value18;
var payment_method;
var value19;
var id;
var value20;
var REQUIRES_CONFIRMATION;
var value21;
var REQUIRES_ACTION;
var value22;
var SUCCEEDED;
var value23;
var PROCESSING;
var value24;
var concat;
var confirmCardPayment;
var value25;
var message;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
try {
binding = env2_0;
} catch (error) {
message = error.message;
return {error: message};
}
try {
binding2 = env2_1;
} catch (error) {
message = error.message;
return {error: message};
}
try {
property = binding2[6];
} catch (error) {
message = error.message;
return {error: message};
}
try {
value3 = binding(property);
} catch (error) {
message = error.message;
return {error: message};
}
try {
HTTP = value3.HTTP;
} catch (error) {
message = error.message;
return {error: message};
}
try {
get = HTTP.get;
} catch (error) {
message = error.message;
return {error: message};
}
try {
object2 = {'url': null, 'oldFormErrors': true, 'rejectWithError': false};
} catch (error) {
message = error.message;
return {error: message};
}
try {
binding = env2_6;
} catch (error) {
message = error.message;
return {error: message};
}
try {
BILLING_STRIPE_PAYMENT_INTENTS = binding.BILLING_STRIPE_PAYMENT_INTENTS;
} catch (error) {
message = error.message;
return {error: message};
}
try {
value4 = Reflect.apply(BILLING_STRIPE_PAYMENT_INTENTS, binding, [a0]);
} catch (error) {
message = error.message;
return {error: message};
}
try {
object2.url = value4;
} catch (error) {
message = error.message;
return {error: message};
}
try {
value5 = Reflect.apply(get, HTTP, [object2]);
} catch (error) {
message = error.message;
return {error: message};
}
yield value5;
try {
value6 = undefined;
value7 = false;
} catch (error) {
message = error.message;
return {error: message};
}
if (value7) {
return value6;
}
try {
body = value6.body;
} catch (error) {
message = error.message;
return {error: message};
}
try {
stripe_payment_intent_client_secret = body.stripe_payment_intent_client_secret;
} catch (error) {
message = error.message;
return {error: message};
}
try {
binding = env2_11;
} catch (error) {
message = error.message;
return {error: message};
}
try {
value8 = binding();
} catch (error) {
message = error.message;
return {error: message};
}
yield value8;
try {
value9 = undefined;
value10 = false;
} catch (error) {
message = error.message;
return {error: message};
}
if (value10) {
return value9;
}
try {
value11 = value9 == null;
} catch (error) {
message = error.message;
return {error: message};
}
if (value11) {
try {
object2 = {};
} catch (error) {
message = error.message;
return {error: message};
}
try {
object2.error = 'unable to load stripe';
} catch (error) {
message = error.message;
return {error: message};
}
} else {
try {
retrievePaymentIntent = value9.retrievePaymentIntent;
} catch (error) {
message = error.message;
return {error: message};
}
try {
value12 = Reflect.apply(retrievePaymentIntent, value9, [stripe_payment_intent_client_secret]);
} catch (error) {
message = error.message;
return {error: message};
}
yield value12;
try {
value13 = undefined;
value14 = false;
} catch (error) {
message = error.message;
return {error: message};
}
if (value14) {
return value13;
}
try {
error = value13.error;
} catch (error) {
message = error.message;
return {error: message};
}
try {
paymentIntent = value13.paymentIntent;
} catch (error) {
message = error.message;
return {error: message};
}
try {
value15 = error != null;
} catch (error) {
message = error.message;
return {error: message};
}
if (value15) {
try {
object2 = {};
} catch (error) {
message = error.message;
return {error: message};
}
try {
message = error.message;
} catch (error) {
message = error.message;
return {error: message};
}
try {
object2.error = message;
} catch (error) {
message = error.message;
return {error: message};
}
return object2;
}
try {
value16 = paymentIntent == null;
} catch (error) {
message = error.message;
return {error: message};
}
if (value16) {
try {
object2 = {};
} catch (error) {
message = error.message;
return {error: message};
}
try {
object2.error = 'payment intent does not exist';
} catch (error) {
message = error.message;
return {error: message};
}
return object2;
}
try {
object2 = {};
} catch (error) {
message = error.message;
return {error: message};
}
try {
status = paymentIntent.status;
} catch (error) {
message = error.message;
return {error: message};
}
try {
binding = env2_9;
} catch (error) {
message = error.message;
return {error: message};
}
try {
REQUIRES_PAYMENT_METHOD = binding.REQUIRES_PAYMENT_METHOD;
} catch (error) {
message = error.message;
return {error: message};
}
var value17 = status === REQUIRES_PAYMENT_METHOD;
if (value17) {
try {
last_payment_error = paymentIntent.last_payment_error;
} catch (error) {
message = error.message;
return {error: message};
}
try {
value18 = last_payment_error != null;
} catch (error) {
message = error.message;
return {error: message};
}
r13 = value18;
} else {
r13 = value17;
}
if (r13) {
try {
last_payment_error = paymentIntent.last_payment_error;
} catch (error) {
message = error.message;
return {error: message};
}
try {
payment_method = last_payment_error.payment_method;
} catch (error) {
message = error.message;
return {error: message};
}
try {
value19 = payment_method != null;
} catch (error) {
message = error.message;
return {error: message};
}
r12 = value19;
} else {
r12 = r13;
}
if (r12) {
try {
last_payment_error = paymentIntent.last_payment_error;
} catch (error) {
message = error.message;
return {error: message};
}
try {
payment_method = last_payment_error.payment_method;
} catch (error) {
message = error.message;
return {error: message};
}
try {
id = payment_method.id;
} catch (error) {
message = error.message;
return {error: message};
}
try {
object2.payment_method = id;
} catch (error) {
message = error.message;
return {error: message};
}
}
try {
status = paymentIntent.status;
} catch (error) {
message = error.message;
return {error: message};
}
try {
binding = env2_9;
} catch (error) {
message = error.message;
return {error: message};
}
try {
REQUIRES_PAYMENT_METHOD = binding.REQUIRES_PAYMENT_METHOD;
} catch (error) {
message = error.message;
return {error: message};
}
try {
value20 = REQUIRES_PAYMENT_METHOD === status;
} catch (error) {
message = error.message;
return {error: message};
}
if (value20) {
try {
confirmCardPayment = value9.confirmCardPayment;
} catch (error) {
message = error.message;
return {error: message};
}
try {
value = Reflect.apply(confirmCardPayment, value9, [stripe_payment_intent_client_secret, object2]);
} catch (error) {
message = error.message;
return {error: message};
}
yield value;
try {
value = undefined;
value25 = false;
} catch (error) {
message = error.message;
return {error: message};
}
if (value25) {
return value;
}
try {
error = value.error;
} catch (error) {
message = error.message;
return {error: message};
}
try {
value = error != null;
} catch (error) {
message = error.message;
return {error: message};
}
if (value) {
try {
object2 = {};
} catch (error) {
message = error.message;
return {error: message};
}
try {
message = error.message;
} catch (error) {
message = error.message;
return {error: message};
}
try {
object2.error = message;
} catch (error) {
message = error.message;
return {error: message};
}
r6 = object2;
} else {
try {
object2 = {};
} catch (error) {
message = error.message;
return {error: message};
}
r6 = object2;
}
return r6;
}
try {
binding = env2_9;
} catch (error) {
message = error.message;
return {error: message};
}
try {
REQUIRES_CONFIRMATION = binding.REQUIRES_CONFIRMATION;
} catch (error) {
message = error.message;
return {error: message};
}
try {
value21 = REQUIRES_CONFIRMATION === status;
} catch (error) {
message = error.message;
return {error: message};
}
if (value21) {
try {
confirmCardPayment = value9.confirmCardPayment;
} catch (error) {
message = error.message;
return {error: message};
}
try {
value = Reflect.apply(confirmCardPayment, value9, [stripe_payment_intent_client_secret, object2]);
} catch (error) {
message = error.message;
return {error: message};
}
yield value;
try {
value = undefined;
value25 = false;
} catch (error) {
message = error.message;
return {error: message};
}
if (value25) {
return value;
}
try {
error = value.error;
} catch (error) {
message = error.message;
return {error: message};
}
try {
value = error != null;
} catch (error) {
message = error.message;
return {error: message};
}
if (value) {
try {
object2 = {};
} catch (error) {
message = error.message;
return {error: message};
}
try {
message = error.message;
} catch (error) {
message = error.message;
return {error: message};
}
try {
object2.error = message;
} catch (error) {
message = error.message;
return {error: message};
}
r6 = object2;
} else {
try {
object2 = {};
} catch (error) {
message = error.message;
return {error: message};
}
r6 = object2;
}
return r6;
}
try {
binding = env2_9;
} catch (error) {
message = error.message;
return {error: message};
}
try {
REQUIRES_ACTION = binding.REQUIRES_ACTION;
} catch (error) {
message = error.message;
return {error: message};
}
try {
value22 = REQUIRES_ACTION === status;
} catch (error) {
message = error.message;
return {error: message};
}
if (value22) {
try {
confirmCardPayment = value9.confirmCardPayment;
} catch (error) {
message = error.message;
return {error: message};
}
try {
value = Reflect.apply(confirmCardPayment, value9, [stripe_payment_intent_client_secret, object2]);
} catch (error) {
message = error.message;
return {error: message};
}
yield value;
try {
value = undefined;
value25 = false;
} catch (error) {
message = error.message;
return {error: message};
}
if (value25) {
return value;
}
try {
error = value.error;
} catch (error) {
message = error.message;
return {error: message};
}
try {
value = error != null;
} catch (error) {
message = error.message;
return {error: message};
}
if (value) {
try {
object2 = {};
} catch (error) {
message = error.message;
return {error: message};
}
try {
message = error.message;
} catch (error) {
message = error.message;
return {error: message};
}
try {
object2.error = message;
} catch (error) {
message = error.message;
return {error: message};
}
r6 = object2;
} else {
try {
object2 = {};
} catch (error) {
message = error.message;
return {error: message};
}
r6 = object2;
}
return r6;
}
try {
binding = env2_9;
} catch (error) {
message = error.message;
return {error: message};
}
try {
SUCCEEDED = binding.SUCCEEDED;
} catch (error) {
message = error.message;
return {error: message};
}
try {
value23 = SUCCEEDED === status;
} catch (error) {
message = error.message;
return {error: message};
}
if (value23) {
return {};
}
try {
binding = env2_9;
} catch (error) {
message = error.message;
return {error: message};
}
try {
PROCESSING = binding.PROCESSING;
} catch (error) {
message = error.message;
return {error: message};
}
try {
value24 = PROCESSING === status;
} catch (error) {
message = error.message;
return {error: message};
}
if (value24) {
return {};
}
try {
binding = env2_9;
} catch (error) {
message = error.message;
return {error: message};
}
try {
binding.CANCELED;
} catch (error) {
message = error.message;
return {error: message};
}
try {
object2 = {};
} catch (error) {
message = error.message;
return {error: message};
}
try {
status = paymentIntent.status;
} catch (error) {
message = error.message;
return {error: message};
}
try {
} catch (error) {
message = error.message;
return {error: message};
}
try {
} catch (error) {
message = error.message;
return {error: message};
}
try {
value = Reflect.apply(concat, 'Invalid Payment Intent status: ', [status]);
} catch (error) {
message = error.message;
return {error: message};
}
try {
object2.error = value;
} catch (error) {
message = error.message;
return {error: message};
}
}
return object2;
}
function parseExpString(a0) { // fn#34908, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4400:1823, owner: validateExpiry.parseExpString, offset: 0x01065a53, size: 241 bytes, params: 2, frame: 17
var environment;
const env0_0 = a0;
const closure = throwErr;
let value = a0.split(RegExp('[.\\-/\\s]+', 'g'));
if (value.length !== 2) {
closure();
}
value = value.map(_fun34910);
const r5 = value[0] > 12 ? [value[1], value[0]] : [value[0], value[1]];
value = environment.__proto__;
value = env1_4(r5, 2);
const property = value[0];
const property2 = value[1];
if (property > 12) {
closure('Month must be a number 1-12, not ' + property + '.');
}
return [property, property2 < 100 ? property2 + 2000 : property2];
}
function throwErr(a0) { // fn#34909, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4400:1850, owner: validateExpiry.parseExpString.throwErr, offset: 0x01065b44, size: 60 bytes, params: 2, frame: 15
return 'You passed an invalid expiration date ' + env0_0 + (a0 ?? '') + 'Please pass a string containing a numeric month and year such as `01-17` or `2015 / 05`';
}
function _fun34910(a0) { // fn#34910, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4400:2094, offset: 0x01065b80, size: 123 bytes, params: 2, frame: 17
const int = global.parseInt(a0);
if (global.isNaN(int)) {
throwErr('' + env0_1 + ' is not a number.');
}
if (int < 1) {
throwErr('' + int + ' is less than one.');
}
return int;
}
+35
View File
@@ -0,0 +1,35 @@
/* Metro module 11977; source: utils/StylesheetUtils.tsx; dependencies: [1861, 2] */
function _fun91946(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#91946, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12163:6, offset: 0x020778a9, size: 96 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/StylesheetUtils.tsx');
exports.getClass = function(a0, a1, a2) {
var r4;
var value = copyRestArgs(2, r4);
value = value.reduce(_fun91948, '');
value = '' + a1 + value;
var property = a0[value];
if (property != null) {
return property;
}
};
}
function getClass(a0, a1, a2) { // fn#91947, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12163:162, offset: 0x02077909, size: 73 bytes, params: 4, frame: 13
let value = copyRestArgs(2, undefined);
value = value.reduce(_fun91948, '');
value = '' + a1 + value;
const property = a0[value];
if (property != null) {
return property;
}
}
function _fun91948(a0, a1) { // fn#91948, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12163:215, offset: 0x02077952, size: 47 bytes, params: 3, frame: 11
let value = environment.__proto__;
value = require(1861) /* metro dependency 1861: StringUtils */;
value = value.upperCaseFirstChar(a1);
return a0 + value;
}
+334
View File
@@ -0,0 +1,334 @@
/* Metro module 8457; source: utils/SubscriptionUtils.tsx; dependencies: [57, 31, 3807, 661, 1880, 44, 8458, 3802, 6847, 566, 8460, 3738, 2] */
function _fun67168(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#67168, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8642:6, offset: 0x01c18522, size: 350 bytes, params: 8, frame: 21
const env0_0 = require;
const _arrayLikeToArray_67171 = 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({items}) {
return items.map(_fun67173);
};
const closure2 = subscriptionCanSwitchImmediately;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
const subscriptionPlanStore = importDefault(3807) /* metro dependency 3807: SubscriptionPlanStore */;
let value = require(661) /* metro dependency 661: Constants */;
const env0_6 = value.SubscriptionStatusTypes;
const env0_7 = value.SubscriptionTypes;
value = require(1880) /* metro dependency 1880: PremiumConstants */;
const env0_8 = value.SubscriptionPlans;
const env0_9 = value.SubscriptionPlanInfo;
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/SubscriptionUtils.tsx');
exports.getSubscriptionPlans = closure;
exports.getSubscriptionSKUs = getSubscriptionSKUs;
exports.subscriptionCanSwitchImmediately = closure2;
exports.subscriptionCanDowngrade = function(a0, a1, a2) {
return !subscriptionCanSwitchImmediately(a0, a1, a2);
};
exports.getOrFetchSubscriptionPlan = getOrFetchSubscriptionPlan;
exports.useGetOrFetchSubscriptionPlan = useGetOrFetchSubscriptionPlan;
exports.getSubscriptionPauseDurations = getSubscriptionPauseDurations;
exports.didBeginPurchaseFlowOnFractionalPremium = didBeginPurchaseFlowOnFractionalPremium;
}
function _createForOfIteratorHelperLoose_67169(a0, a1) { // fn#67169, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8642:250, offset: 0x01c18680, size: 372 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 _fun67170;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_67171(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_67171(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_67171(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun67170;
}
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 getSubscriptionPlans({items}) { // fn#67172, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8642:1160, offset: 0x01c187f4, size: 30 bytes, params: 2, frame: 11
return items.map(_fun67173);
}
function subscriptionCanSwitchImmediately(a0, a1, a2) { // fn#67174, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8642:1291, offset: 0x01c18856, size: 274 bytes, params: 4, frame: 14
var object4;
const CheckoutError = (require(8458) /* metro dependency 8458: CheckoutError */).CheckoutError;
var object2;
var object3;
let value = a0.getCurrentSubscriptionPlanIdForGroup(a2);
const type = a0.type;
const PREMIUM = SubscriptionTypes.PREMIUM;
if (type !== PREMIUM) {
object4 = {oldPlanId: value, newPlanId: a1};
if (value == null) {
object3 = {message: 'Current subscription has no plan in group', extraSentryInformation: object4};
throw new CheckoutError();
}
if (value !== SubscriptionPlans.PREMIUM_YEAR_TIER_1) {
value = a2.indexOf(value);
return value < a2.indexOf(a1);
}
if (a1 === SubscriptionPlans.PREMIUM_MONTH_TIER_2) {
object2 = {message: 'Unexpected plan switch', extraSentryInformation: object4};
throw new CheckoutError();
}
} else {
if (value == null) {
return true;
}
object4 = {oldPlanId: value, newPlanId: a1};
if (value == null) {
object3 = {message: 'Current subscription has no plan in group', extraSentryInformation: object4};
throw new CheckoutError();
}
if (value !== SubscriptionPlans.PREMIUM_YEAR_TIER_1) {
value = a2.indexOf(value);
return value < a2.indexOf(a1);
}
if (a1 === SubscriptionPlans.PREMIUM_MONTH_TIER_2) {
object2 = {message: 'Unexpected plan switch', extraSentryInformation: object4};
throw new CheckoutError();
}
}
value = a2.indexOf(value);
return value < a2.indexOf(a1);
}
function getSubscriptionSKUs(a0) { // fn#67175, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8642:1901, offset: 0x01c18968, size: 38 bytes, params: 2, frame: 11
return getSubscriptionPlans(a0).map(function(a0) {
return a0.skuId;
});
}
function getOrFetchSubscriptionPlan(a0, a1) { // fn#67178, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8642:2199, offset: 0x01c189ac, size: 180 bytes, params: 3, frame: 19
var property;
var moduleValue;
var value4;
const value2 = SubscriptionPlanStore.get(a0);
if (value2 == null) {
property = SubscriptionPlanInfo[a0];
(importDefault(44) /* metro dependency 44 */)(property != null, 'Missing hardcoded subscriptionPlan: ' + a0);
moduleValue = require(3802) /* metro dependency 3802: PremiumUtils */;
value4 = moduleValue.castPremiumSubscriptionAsSkuId(property.skuId);
if (!SubscriptionPlanStore.isFetchingForSKU(value4)) {
(require(6847) /* metro dependency 6847: SubscriptionPlanActionCreators */).fetchSubscriptionPlansForSKU(value4,
a1);
}
}
return value2;
}
function useGetOrFetchSubscriptionPlan(a0, a1) { // fn#67179, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8642:2502, offset: 0x01c18a60, size: 150 bytes, params: 3, frame: 18
const env0_0 = a0;
const env0_1 = a1;
const fluxModule = require(566) /* metro dependency 566: flux */;
const useStateFromStoresArray = fluxModule.useStateFromStoresArray;
const value3 = env0_3(Reflect.apply(useStateFromStoresArray, fluxModule, [[SubscriptionPlanStore], _fun67180]), 2);
const property = value3[0];
env0_4.useEffect(_fun67181, [property, a0, a1, value3[1]]);
return property;
}
function getSubscriptionPauseDurations(a0) { // fn#67182, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8642:2957, offset: 0x01c18bf5, size: 327 bytes, params: 2, frame: 21
var r4;
var items;
var value4;
var value5;
var Math;
var value6;
var value7;
var value8;
var done;
var value9;
var value10;
const Object = global.Object;
const keys = Object.keys;
const PauseDuration = (require(8460) /* metro dependency 8460: PauseDuration */).PauseDuration;
const value3 = Reflect.apply(keys, Object, [PauseDuration]).filter(function(a0) {
return global.isNaN((0, global.Number)(a0));
});
const status = a0.status;
const PAUSED = SubscriptionStatusTypes.PAUSED;
if (status !== PAUSED) {
return {durations: value3, currentDaysPaused: 0};
}
if (a0.pauseEndsAt != null) {
value4 = (importDefault(3738) /* metro dependency 3738 */)(a0.currentPeriodStart);
value5 = (importDefault(3738) /* metro dependency 3738 */)(a0.pauseEndsAt);
Math = global.Math;
value6 = Math.round(value5.diff(value4, 'days', true));
items = [];
value7 = _createForOfIteratorHelperLoose_67169(value3);
value8 = value7();
done = value8.done;
if (!done) {
r4 = value8;
while (true) {
value9 = r4.value;
if (PauseDuration[value9] > value6) {
items.push(value9);
}
value10 = value7();
done = value10.done;
if (done) {
break;
}
r4 = value10;
continue;
}
}
return {durations: items, currentDaysPaused: value6};
}
return {durations: [], currentDaysPaused: 0};
}
function didBeginPurchaseFlowOnFractionalPremium(a0) { // fn#67184, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8642:3499, offset: 0x01c18d3c, size: 93 bytes, params: 2, frame: 14
var r0;
let value = a0 != null;
if (value) {
value = importDefault(3738) /* metro dependency 3738 */;
value = value.isMoment(a0);
r0 = value;
} else {
r0 = value;
}
r0 = r0 && a0.isSameOrAfter((importDefault(3738) /* metro dependency 3738 */)());
return r0;
}
function _fun67173({planId}) { // fn#67173, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8642:1213, offset: 0x01c18812, size: 68 bytes, params: 2, frame: 14
const value = environment.__proto__;
const value2 = SubscriptionPlanStore.get(planId);
(importDefault(44) /* metro dependency 44 */)(value2 != null, 'Unable to fetch plan');
return value2;
}
function _fun67180() { // fn#67180, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8642:2590, offset: 0x01c18af6, size: 83 bytes, params: 1, frame: 13
var r1;
const value2 = null;
const r2 = value2 != env0_0 ? SubscriptionPlanStore.get(env0_0) : value2;
const items2 = [r2];
let value = value2 != r2;
if (value) {
value = environment.__proto__;
value = SubscriptionPlanStore.isFetchingForSKU(r2.skuId);
r1 = value;
} else {
r1 = value;
}
items2[1] = r1;
return items2;
}
function _fun67181() { // fn#67181, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8642:2716, offset: 0x01c18b49, size: 172 bytes, params: 1, frame: 19
var value2;
var binding;
var property;
var moduleValue;
var fetchSubscriptionPlansForSKU;
var moduleValue2;
if (env0_2 == null) {
if (env0_0 != null) {
if (!env0_3) {
value2 = environment.__proto__;
binding = env0_0;
property = SubscriptionPlanInfo[binding];
(importDefault(44) /* metro dependency 44 */)(property != null,
'Missing hardcoded subscriptionPlan: ' + binding);
moduleValue = require(6847) /* metro dependency 6847: SubscriptionPlanActionCreators */;
fetchSubscriptionPlansForSKU = moduleValue.fetchSubscriptionPlansForSKU;
moduleValue2 = require(3802) /* metro dependency 3802: PremiumUtils */;
Reflect.apply(fetchSubscriptionPlansForSKU, moduleValue,
[moduleValue2.castPremiumSubscriptionAsSkuId(property.skuId), require]);
}
}
}
}
+544
View File
@@ -0,0 +1,544 @@
/* Metro module 8233; source: utils/SystemMessageUtils.tsx; dependencies: [57, 3794, 1226, 1379, 1867, 3793, 1878, 661, 1244, 21, 6713, 8234, 4617, 4805, 8235, 8237, 4634, 4625, 8238, 8239, 5059, 2] */
function _fun65852(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#65852, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8418:6, offset: 0x01be1e56, size: 345 bytes, params: 8, frame: 20
var object2;
const env0_0 = require;
const closure = getSystemMessageUserJoinMobile;
const getSystemMessageUserPremiumGuildSubscription = function(a0) {
return require(dependencyMap[10]).astToString(require(dependencyMap[8]).intl.formatToParts(require(dependencyMap[8]).t.ihxM9x,
{username: a0, usernameOnClick: NOOP}));
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const messageRecord = importDefault(3794) /* metro dependency 3794: MessageRecord */;
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
const relationshipStore = importDefault(3793) /* metro dependency 3793: RelationshipStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_10 = constantsModule.MessageEmbedTypes;
const env0_11 = constantsModule.MessageTypes;
const env0_12 = constantsModule.NOOP;
const env0_13 = {'234395307759108106': 'https://groovy.bot/commands',
'365975655608745985': 'https://www.pokecord.com/getting-started',
'512412940897484800': 'http://jameslantz.net/smilebot'};
object2 = {stringify: stringify_65856, getSystemMessageUserJoin: getSystemMessageUserJoin,
getSystemMessageUserJoinMobile: closure, getSystemMessageBotJoin: getSystemMessageBotJoin};
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/SystemMessageUtils.tsx');
exports.default = object2;
}
function getSystemMessageUserJoinMobile(a0) { // fn#65853, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8418:395, offset: 0x01be1faf, size: 403 bytes, params: 2, frame: 15
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const Jm6e0x = t.Jm6e0x;
const items2 = [Jm6e0x];
const MGRnRT = t.MGRnRT;
items2[1] = MGRnRT;
const EXOEGh = t.EXOEGh;
items2[2] = EXOEGh;
items2[3] = t['5uCTFN'];
items2[4] = t.rl45Qo;
const Bh9zpQ = t.Bh9zpQ;
items2[5] = Bh9zpQ;
const RdEy1J = t.RdEy1J;
items2[6] = RdEy1J;
items2[7] = t.qcdp00;
const F7w2Ru = t.F7w2Ru;
items2[8] = F7w2Ru;
items2[9] = t.gSyOgK;
items2[10] = t.uYgqv7;
items2[11] = t['b/1SBX'];
const LhebZF = t.LhebZF;
items2[12] = LhebZF;
let value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
value = value.extractTimestamp(a0);
return items2[value % items2.length];
}
function getSystemMessageUserPremiumGuildSubscriptionAchievedTier(a0, a1) { // fn#65855, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8418:927, offset: 0x01be21ac, size: 174 bytes, params: 3, frame: 19
var r0;
var moduleValue;
var astToString;
var intl;
const channel = ChannelStore.getChannel(a1);
if (channel == null) {
r0 = getSystemMessageUserPremiumGuildSubscription(a0);
} else if (GuildStore.getGuild(channel.getGuildId()) == null) {
r0 = getSystemMessageUserPremiumGuildSubscription(a0);
} else {
moduleValue = require(6713) /* metro dependency 6713: MarkupParser */;
astToString = moduleValue.astToString;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r0 = Reflect.apply(astToString, moduleValue,
[intl.formatToParts((require(1244) /* metro dependency 1244: indexNative */).t.ihxM9x, {username: a0,
usernameOnClick: NOOP})]);
}
return r0;
}
function stringify_65856(a0, a1) { // fn#65856, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8418:1232, offset: 0x01be225a, size: 3648 bytes, params: 3, frame: 34
var r2;
var r4;
var r11;
var r18;
var r16;
var name;
var r15;
var r1;
var object2;
var value5;
var user;
var value7;
var content;
var channel;
var value10;
var astToString;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var formatToParts;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var channel2;
var value12;
var iOuWPk;
var value13;
var date;
var embeds;
var value17;
var channel3;
var value21;
const AutomodNotificationEmbedTypeKeys = (require(8234) /* metro dependency 8234: AutomodNotificationEmbedTypeKeys */).AutomodNotificationEmbedTypeKeys;
var moduleValue;
var getPrivateChannelIntegrationRemovedSystemMessageASTContent;
var moduleValue2;
var getMessageAuthor;
var moduleValue3;
var moduleValue4;
var getPrivateChannelIntegrationAddedSystemMessageASTContent;
var moduleValue5;
var moduleValue6;
var moduleValue7;
var moduleValue8;
var moduleValue9;
var purchase_notification;
var moduleValue10;
var moduleValue11;
var formatToPlainString;
var value22;
var moduleValue12;
var PJsjbP;
var intl3;
var call;
var participants;
var moduleValue13;
var QtZ0RD;
var moduleValue14;
const mentions = a0.mentions;
let value = null;
const r6 = value != mentions ? mentions : [];
const value3 = undefined;
let property = env0_3(r6, 1)[0];
if (value == property) {
r11 = value;
} else {
value5 = typeof property;
if (value5 === 'object') {
value7 = UserStore.getUser(property.id);
r2 = value != value7 ? value7 : value;
} else if (value5 !== 'string') {
r2 = value;
} else {
user = UserStore.getUser(property);
r2 = value != user ? user : value;
}
r11 = r2;
}
const channel_id = a0.channel_id;
const defaultImport = importDefault(4617) /* metro dependency 4617: NicknameUtils */;
const getName = defaultImport.getName;
let author = a0.author;
const value8 = Reflect.apply(getName, defaultImport, [value, channel_id, author]);
const type = a0.type;
const RECIPIENT_ADD = MessageTypes.RECIPIENT_ADD;
if (RECIPIENT_ADD === type) {
if (value == r11) {
return value3;
}
moduleValue14 = require(6713) /* metro dependency 6713: MarkupParser */;
astToString = moduleValue14.astToString;
formatToParts = intl.formatToParts;
property = t['7/Xl0S'];
object2 = {username: value8};
object2.usernameOnClick = NOOP;
object2.otherUsername = defaultImport.getName(value, channel_id, r11);
object2.otherUsernameOnClick = NOOP;
return Reflect.apply(astToString, moduleValue14, [Reflect.apply(formatToParts, intl, [property, object2])]);
}
const RECIPIENT_REMOVE = MessageTypes.RECIPIENT_REMOVE;
if (RECIPIENT_REMOVE === type) {
if (value == r11) {
return value3;
}
author = a0.author;
if (value == author) {
value = require(6713) /* metro dependency 6713: MarkupParser */;
value = value.astToString(intl.formatToParts(t['Qn5+Lf'], {username: value8, usernameOnClick: NOOP}));
r1 = value;
} else if (author.id === r11.id) {
value = require(6713) /* metro dependency 6713: MarkupParser */;
value = value.astToString(intl.formatToParts(t['Qn5+Lf'], {username: value8, usernameOnClick: NOOP}));
r1 = value;
} else {
moduleValue13 = require(6713) /* metro dependency 6713: MarkupParser */;
astToString = moduleValue13.astToString;
formatToParts = intl.formatToParts;
QtZ0RD = t.QtZ0RD;
object2 = {username: value8};
object2.usernameOnClick = NOOP;
object2.otherUsername = defaultImport.getName(value, channel_id, r11);
object2.otherUsernameOnClick = NOOP;
value = Reflect.apply(astToString, moduleValue13, [Reflect.apply(formatToParts, intl, [QtZ0RD, object2])]);
r1 = value;
}
return r1;
}
const CALL = MessageTypes.CALL;
if (CALL === type) {
call = a0.call;
if (value != call) {
participants = call.participants;
value = participants.indexOf(AuthenticationStore.getId());
if (value !== -1) {
r2 = value3;
} else {
value = require(6713) /* metro dependency 6713: MarkupParser */;
value = value.astToString(intl.formatToParts(t.DbgSA0, {username: value8, usernameOnClick: NOOP}));
r2 = value;
}
} else {
r2 = value3;
}
return r2;
}
const CHANNEL_NAME_CHANGE = MessageTypes.CHANNEL_NAME_CHANGE;
if (CHANNEL_NAME_CHANGE === type) {
value = require(6713) /* metro dependency 6713: MarkupParser */;
return value.astToString(intl.formatToParts(a1.isForumPost() ? t['qa0e/n'] : t.XCPMEG, {username: value8,
usernameOnClick: NOOP, channelName: a0.content}));
}
const CHANNEL_ICON_CHANGE = MessageTypes.CHANNEL_ICON_CHANGE;
if (CHANNEL_ICON_CHANGE === type) {
value = require(6713) /* metro dependency 6713: MarkupParser */;
return value.astToString(intl.formatToParts(t.wypJZ0, {username: value8, usernameOnClick: NOOP}));
}
const CHANNEL_PINNED_MESSAGE = MessageTypes.CHANNEL_PINNED_MESSAGE;
if (CHANNEL_PINNED_MESSAGE === type) {
value = require(6713) /* metro dependency 6713: MarkupParser */;
return value.astToString(intl.formatToParts(t['/M60j0'], {username: value8, usernameOnClick: NOOP}));
}
const USER_JOIN = MessageTypes.USER_JOIN;
if (USER_JOIN === type) {
value = require(6713) /* metro dependency 6713: MarkupParser */;
return value.astToString(intl.formatToParts(getSystemMessageUserJoinMobile(a0.id), {username: value8,
usernameOnClick: NOOP}));
}
const EMOJI_ADDED = MessageTypes.EMOJI_ADDED;
if (EMOJI_ADDED === type) {
value22 = ChannelStore.getChannel(a0.channel_id);
r16 = value == value22 ? value : GuildStore.getGuild(value22.getGuildId());
moduleValue12 = require(6713) /* metro dependency 6713: MarkupParser */;
astToString = moduleValue12.astToString;
formatToParts = intl.formatToParts;
PJsjbP = t.PJsjbP;
object2 = {};
object2.emoji = a0.content;
name = value == r16 ? value3 : r16.name;
if (value != name) {
r15 = name;
} else {
intl3 = (require(1244) /* metro dependency 1244: indexNative */).intl;
r15 = intl3.string(t.dtwqPR);
}
object2.guildName = r15;
return Reflect.apply(astToString, moduleValue12, [Reflect.apply(formatToParts, intl, [PJsjbP, object2])]);
}
const GUILD_BOOST = MessageTypes.GUILD_BOOST;
if (GUILD_BOOST === type) {
return getSystemMessageUserPremiumGuildSubscription(value8);
}
const GUILD_BOOST_TIER_1 = MessageTypes.GUILD_BOOST_TIER_1;
if (GUILD_BOOST_TIER_1 === type) {
return getSystemMessageUserPremiumGuildSubscriptionAchievedTier(value8, channel_id);
}
const GUILD_BOOST_TIER_2 = MessageTypes.GUILD_BOOST_TIER_2;
if (GUILD_BOOST_TIER_2 === type) {
return getSystemMessageUserPremiumGuildSubscriptionAchievedTier(value8, channel_id);
}
const GUILD_BOOST_TIER_3 = MessageTypes.GUILD_BOOST_TIER_3;
if (GUILD_BOOST_TIER_3 === type) {
return getSystemMessageUserPremiumGuildSubscriptionAchievedTier(value8, channel_id);
}
const GUILD_INVITE_REMINDER = MessageTypes.GUILD_INVITE_REMINDER;
if (GUILD_INVITE_REMINDER === type) {
return intl.string(t.gxyKvr);
}
const THREAD_STARTER_MESSAGE = MessageTypes.THREAD_STARTER_MESSAGE;
if (THREAD_STARTER_MESSAGE === type) {
formatToPlainString = intl.formatToPlainString;
property = t['B8H+Cl'];
object2 = {username: value8};
object2.threadName = (require(4805) /* metro dependency 4805: useChannelName */).computeChannelName(a1,
UserStore,
RelationshipStore);
return Reflect.apply(formatToPlainString, intl, [property, object2]);
}
const ROLE_SUBSCRIPTION_PURCHASE = MessageTypes.ROLE_SUBSCRIPTION_PURCHASE;
if (ROLE_SUBSCRIPTION_PURCHASE === type) {
if (a0 instanceof MessageRecord) {
r2 = value;
} else {
value = require(6713) /* metro dependency 6713: MarkupParser */;
astToString = value.astToString;
moduleValue11 = require(8235) /* metro dependency 8235: GuildRoleSubscriptionSystemMessageUtils */;
value = Reflect.apply(astToString, value,
[moduleValue11.getRoleSubscriptionPurchaseSystemMessageContentMobile({username: value8,
guildId: a1.guild_id,
roleSubscriptionData: a0.role_subscription_data})]);
r2 = value;
}
return r2;
}
const PURCHASE_NOTIFICATION = MessageTypes.PURCHASE_NOTIFICATION;
if (PURCHASE_NOTIFICATION === type) {
if (a0 instanceof MessageRecord) {
r2 = value;
} else {
purchase_notification = a0.purchase_notification;
if (value == (value == purchase_notification || value == purchase_notification.guild_product_purchase ? value3 : purchase_notification.guild_product_purchase.product_name)) {
r2 = value;
} else {
value = require(6713) /* metro dependency 6713: MarkupParser */;
astToString = value.astToString;
moduleValue10 = require(8237) /* metro dependency 8237: GuildProductSystemMessageUtils */;
value = Reflect.apply(astToString, value,
[moduleValue10.getGuildProductPurchaseSystemMessageContentMobile({username: value8,
productName: a0.purchase_notification.guild_product_purchase.product_name})]);
r2 = value;
}
}
return r2;
}
const GUILD_APPLICATION_PREMIUM_SUBSCRIPTION = MessageTypes.GUILD_APPLICATION_PREMIUM_SUBSCRIPTION;
if (GUILD_APPLICATION_PREMIUM_SUBSCRIPTION === type) {
if (a0 instanceof MessageRecord) {
return value;
}
value = require(4634) /* metro dependency 4634: useMessageAuthor */;
getMessageAuthor = value.getMessageAuthor;
moduleValue7 = require(4625) /* metro dependency 4625: MessageRecordUtils */;
value = Reflect.apply(getMessageAuthor, value, [moduleValue7.createMessageRecord(a0)]);
moduleValue8 = require(6713) /* metro dependency 6713: MarkupParser */;
astToString = moduleValue8.astToString;
moduleValue9 = require(8238) /* metro dependency 8238: ApplicationSubscriptionSystemMessageUtils */;
return Reflect.apply(astToString, moduleValue8,
[moduleValue9.getApplicationSubscriptionSystemMessageASTContent({application: a0.application,
username: value.nick})]);
}
const PRIVATE_CHANNEL_INTEGRATION_ADDED = MessageTypes.PRIVATE_CHANNEL_INTEGRATION_ADDED;
if (PRIVATE_CHANNEL_INTEGRATION_ADDED === type) {
if (a0 instanceof MessageRecord) {
r2 = value;
} else {
value = require(6713) /* metro dependency 6713: MarkupParser */;
astToString = value.astToString;
moduleValue4 = require(8239) /* metro dependency 8239: PrivateChannelIntegrationSystemMessageUtils */;
getPrivateChannelIntegrationAddedSystemMessageASTContent = moduleValue4.getPrivateChannelIntegrationAddedSystemMessageASTContent;
object2 = {};
object2.application = a0.application;
moduleValue5 = require(4634) /* metro dependency 4634: useMessageAuthor */;
getMessageAuthor = moduleValue5.getMessageAuthor;
moduleValue6 = require(4625) /* metro dependency 4625: MessageRecordUtils */;
object2.username = Reflect.apply(getMessageAuthor, moduleValue5,
[moduleValue6.createMessageRecord(a0)]).nick;
value = Reflect.apply(astToString, value,
[Reflect.apply(getPrivateChannelIntegrationAddedSystemMessageASTContent,
moduleValue4, [object2])]);
r2 = value;
}
return r2;
}
const PRIVATE_CHANNEL_INTEGRATION_REMOVED = MessageTypes.PRIVATE_CHANNEL_INTEGRATION_REMOVED;
if (PRIVATE_CHANNEL_INTEGRATION_REMOVED === type) {
if (a0 instanceof MessageRecord) {
r2 = value;
} else {
value = require(6713) /* metro dependency 6713: MarkupParser */;
astToString = value.astToString;
moduleValue = require(8239) /* metro dependency 8239: PrivateChannelIntegrationSystemMessageUtils */;
getPrivateChannelIntegrationRemovedSystemMessageASTContent = moduleValue.getPrivateChannelIntegrationRemovedSystemMessageASTContent;
object2 = {};
object2.application = a0.application;
moduleValue2 = require(4634) /* metro dependency 4634: useMessageAuthor */;
getMessageAuthor = moduleValue2.getMessageAuthor;
moduleValue3 = require(4625) /* metro dependency 4625: MessageRecordUtils */;
object2.username = Reflect.apply(getMessageAuthor, moduleValue2,
[moduleValue3.createMessageRecord(a0)]).nick;
value = Reflect.apply(astToString, value,
[Reflect.apply(getPrivateChannelIntegrationRemovedSystemMessageASTContent,
moduleValue, [object2])]);
r2 = value;
}
return r2;
}
const AUTO_MODERATION_ACTION = MessageTypes.AUTO_MODERATION_ACTION;
if (AUTO_MODERATION_ACTION === type) {
embeds = a0.embeds;
if (value == embeds) {
return a0.content;
}
if (embeds.some(function({type}) {
return type === MessageEmbedTypes.AUTO_MODERATION_NOTIFICATION;
})) {
value17 = a0.embeds.find(_fun65858);
r2 = value == value17 || value == value17.fields ? value3 : value17.fields.find(_fun65859);
r4 = value != r2 && 'value' in r2 ? r2.value : value3;
channel3 = ChannelStore.getChannel(channel_id);
if (value == channel3) {
r2 = value;
} else {
value21 = GuildStore.getGuild(channel3.getGuildId());
if (value == value21) {
r2 = value;
} else if (AutomodNotificationEmbedTypeKeys.ACTIVITY_ALERTS_ENABLED === r4) {
value = require(6713) /* metro dependency 6713: MarkupParser */;
value = value.astToString(intl.formatToParts(t.wt3ZUM, {guildName: value21.name}));
r2 = value;
} else if (AutomodNotificationEmbedTypeKeys.INTERACTION_BLOCKED === r4) {
value = require(6713) /* metro dependency 6713: MarkupParser */;
value = value.astToString(intl.formatToParts(t.AkqI0g, {guildName: value21.name}));
r2 = value;
} else {
value = require(6713) /* metro dependency 6713: MarkupParser */;
value = value.astToString(intl.formatToParts(t['a+lJKl'], {guildName: value21.name}));
r2 = value;
}
}
return r2;
}
} else {
var GUILD_INCIDENT_ALERT_MODE_ENABLED = MessageTypes.GUILD_INCIDENT_ALERT_MODE_ENABLED;
if (GUILD_INCIDENT_ALERT_MODE_ENABLED === type) {
content = a0.content;
channel2 = ChannelStore.getChannel(channel_id);
if (value == channel2) {
r2 = value;
} else {
value12 = GuildStore.getGuild(channel2.getGuildId());
if (value == value12) {
r4 = value;
} else {
value = require(6713) /* metro dependency 6713: MarkupParser */;
astToString = value.astToString;
formatToParts = intl.formatToParts;
iOuWPk = t.iOuWPk;
object2 = {username: value8};
object2.guildName = value12.name;
value13 = '';
if (value13 === content) {
r18 = value13;
} else {
date = new global.Date();
r18 = date.toLocaleString((require(1244) /* metro dependency 1244: indexNative */).intl.currentLocale,
{'hour': 'numeric', 'minute': '2-digit'});
}
object2.time = r18;
value = Reflect.apply(astToString, value, [Reflect.apply(formatToParts, intl, [iOuWPk, object2])]);
r4 = value;
}
r2 = r4;
}
return r2;
}
var GUILD_INCIDENT_ALERT_MODE_DISABLED = MessageTypes.GUILD_INCIDENT_ALERT_MODE_DISABLED;
if (GUILD_INCIDENT_ALERT_MODE_DISABLED === type) {
channel = ChannelStore.getChannel(channel_id);
if (value == channel) {
r2 = value;
} else {
value10 = GuildStore.getGuild(channel.getGuildId());
if (value == value10) {
r4 = value;
} else {
value = require(6713) /* metro dependency 6713: MarkupParser */;
value = value.astToString(intl.formatToParts(t.axmbpm, {username: value8,
guildName: value10.name}));
r4 = value;
}
r2 = r4;
}
return r2;
}
}
return a0.content;
}
function getSystemMessageUserJoin(a0) { // fn#65860, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8418:6720, offset: 0x01be30f3, size: 403 bytes, params: 2, frame: 15
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const items2 = [t['0cuj7l']];
items2[1] = t['MuW+CN'];
items2[2] = t.osqpHX;
items2[3] = t['5ToSh2'];
const JEB8ps = t.JEB8ps;
items2[4] = JEB8ps;
items2[5] = t.pkOV5T;
items2[6] = t['kRb1J+'];
items2[7] = t['EmKLY+'];
items2[8] = t.rPtBnb;
items2[9] = t['5B/ekS'];
const ESNC3Y = t.ESNC3Y;
items2[10] = ESNC3Y;
const Iw6d8w = t.Iw6d8w;
items2[11] = Iw6d8w;
items2[12] = t['WecSZ/'];
let value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
value = value.extractTimestamp(a0);
return items2[value % items2.length];
}
function getSystemMessageBotJoin(a0) { // fn#65861, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8418:7180, offset: 0x01be3286, size: 114 bytes, params: 2, frame: 17
var r0;
var intl;
const env0_0 = a0;
const value2 = null;
if (value2 == env0_13[a0]) {
r0 = value2;
} else {
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r0 = intl.format((require(1244) /* metro dependency 1244: indexNative */).t.xw1Ij0,
{learnOnClick: {onClick: onClick_65862}});
}
return r0;
}
function _fun65859(a0) { // fn#65859, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8418:5219, offset: 0x01be30b5, size: 62 bytes, params: 2, frame: 13
var r0;
var name;
let value = 'name' in a0;
if (value) {
name = a0.name;
value = environment.__proto__;
value = name === (require(5059) /* metro dependency 5059: AutomodNotificationEmbedKeys */).AutomodNotificationEmbedKeys.NOTIFICATION_TYPE;
r0 = value;
} else {
r0 = value;
}
return r0;
}
function getSystemMessageBotJoinOnClick() { // fn#65862, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8418:7299, owner: getSystemMessageBotJoin.onClick, offset: 0x01be32f8, size: 39 bytes, params: 1, frame: 12
const window = global.window;
return window.open(env1_13[env0_0]);
}
Loaded 100 of 16065 files, more files were not shown because too many files have changed in this diff. Show more