Initial commit
This commit is contained in:
commit
af3b49f756
16065 files changed
+2938410
No files matched your search
@@ -0,0 +1,889 @@
|
||||
/* Metro module 7227; source: lib/uploader/UploaderBase.tsx; dependencies: [5, 6, 7, 15, 17, 18, 661, 4503, 3, 4658, 22, 4692, 4697, 4659, 639, 2] */
|
||||
function _fun57858(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57858, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:6, offset: 0x016b7d68, size: 332 bytes, params: 8, frame: 19
|
||||
const env0_0 = require;
|
||||
const _arrayLikeToArray_57861 = 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_3 = importDefault(5) /* metro dependency 5 */;
|
||||
const env0_4 = importDefault(6) /* metro dependency 6 */;
|
||||
const env0_5 = importDefault(7) /* metro dependency 7 */;
|
||||
const env0_6 = importDefault(15) /* metro dependency 15 */;
|
||||
const env0_7 = importDefault(17) /* metro dependency 17 */;
|
||||
const env0_8 = importDefault(18) /* metro dependency 18 */;
|
||||
const env0_9 = (require(661) /* metro dependency 661: Constants */).AbortCodes;
|
||||
const env0_10 = (require(4503) /* metro dependency 4503: MessageConstants */).FileUploadErrorTypes;
|
||||
let value = importDefault(3) /* metro dependency 3: Logger */;
|
||||
value = new value('UploaderBase.tsx');
|
||||
const EventEmitter = (require(639) /* metro dependency 639 */).EventEmitter;
|
||||
value = _fun57865(EventEmitter);
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('lib/uploader/UploaderBase.tsx');
|
||||
exports.default = value;
|
||||
}
|
||||
|
||||
function _createForOfIteratorHelperLoose_57859(a0, a1) { // fn#57859, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:214, offset: 0x016b7eb4, 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 _fun57860;
|
||||
}
|
||||
value = undefined;
|
||||
if (a0) {
|
||||
if (typeof a0 === 'string') {
|
||||
value = _arrayLikeToArray_57861(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_57861(a0, value);
|
||||
r6 = value;
|
||||
} else {
|
||||
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
||||
if (regexp.test(r9)) {
|
||||
value = _arrayLikeToArray_57861(a0, value);
|
||||
r6 = value;
|
||||
} else {
|
||||
r6 = value;
|
||||
}
|
||||
}
|
||||
r5 = r6;
|
||||
}
|
||||
} else {
|
||||
r5 = value;
|
||||
}
|
||||
if (r5) {
|
||||
if (r5) {
|
||||
}
|
||||
return _fun57860;
|
||||
}
|
||||
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 _isNativeReflectConstruct_57862() { // fn#57862, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:1124, offset: 0x016b8026, 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_57862_isNativeReflectConstruct = function() {
|
||||
return !!result;
|
||||
})();
|
||||
}
|
||||
|
||||
function _fun57865(a0) { // fn#57865, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:1358, offset: 0x016b8084, size: 344 bytes, params: 2, frame: 17
|
||||
const closure = UploaderBase;
|
||||
env0_8(closure, a0);
|
||||
const binding = env0_5;
|
||||
const items2 = [{key: '_fileSize', value: function() {
|
||||
return this.files.reduce(_fun57875, 0);
|
||||
}}];
|
||||
const binding2 = env0_3;
|
||||
const env0_1 = binding2(_fun57877);
|
||||
items2[1] = {key: 'compressAndCheckFileSize', value: value_57878};
|
||||
items2[2] = {key: 'setUploadingTextForUI', value: value_57879};
|
||||
items2[3] = {key: '_recomputeProgress', value: function() {
|
||||
var value = this._recomputeProgressTotal();
|
||||
this._handleProgress(value.loaded, value.total, this._recomputeProgressByFile());
|
||||
}};
|
||||
items2[4] = {key: '_recomputeProgressTotal', value: function() {
|
||||
var value = this._fileSize();
|
||||
var object = {};
|
||||
object.loaded = this.files.reduce(_fun57884, 0);
|
||||
object.total = value;
|
||||
return object;
|
||||
}};
|
||||
items2[5] = {key: '_recomputeProgressByFile', value: function() {
|
||||
this.files.forEach(_fun57886);
|
||||
return {};
|
||||
}};
|
||||
items2[6] = {key: '_addAttachmentsToPayload', value: value_57887};
|
||||
items2[7] = {key: 'clearProcessingMessageInterval', value: function() {
|
||||
if (this.processingMessageChangeInterval != null) {
|
||||
global.clearInterval(this.processingMessageChangeInterval);
|
||||
this.processingMessageChangeInterval = undefined;
|
||||
}
|
||||
}};
|
||||
items2[8] = {key: 'cancel', value: value_57889};
|
||||
const env0_0 = binding2(_fun57892);
|
||||
items2[9] = {key: 'cancelItem', value: value_57894};
|
||||
items2[10] = {key: 'upload', value: function(a0) {
|
||||
if (this._cancel != null) {
|
||||
throw new global.Error('Uploader.upload(...): An upload is already in progress.');
|
||||
}
|
||||
this._lastUpdate = global.Date.now();
|
||||
this._loaded = 0;
|
||||
this._file = {'id': null, 'currentSize': 0, 'totalPreCompressionSize': 0, 'compressionProgress': 0,
|
||||
'progress': 0,
|
||||
'rate': 0, 'hasImage': false, 'hasVideo': false, 'attachmentsCount': 0, id: this.id, items: a0};
|
||||
}};
|
||||
return binding(closure, items2);
|
||||
}
|
||||
|
||||
function UploaderBase() { // fn#57866, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:1370, offset: 0x016b81dc, size: 303 bytes, params: 1, frame: 21
|
||||
var environment;
|
||||
const value = environment.__proto__;
|
||||
env1_4(this, UploaderBase);
|
||||
const value3 = env1_7(UploaderBase);
|
||||
const value6 = env1_6(this, _isNativeReflectConstruct_57862() ? global.Reflect.construct(value3, [],
|
||||
env1_7(this).constructor) : value3.apply(this, undefined));
|
||||
value6._aborted = false;
|
||||
value6._errored = false;
|
||||
value6.files = [];
|
||||
value6._lastUpdate = 0;
|
||||
value6._loaded = 0;
|
||||
value6.alreadyStarted = false;
|
||||
value6._handleStart = _handleStart;
|
||||
value6._handleProgress = _handleProgress;
|
||||
value6._handleException = _handleException;
|
||||
value6._handleAborted = _handleAborted;
|
||||
value6._handleError = _handleError;
|
||||
value6._handleComplete = _handleComplete;
|
||||
value6.id = (importDefault(22) /* metro dependency 22 */).uniqueId('Uploader');
|
||||
value6._file = {'id': null, 'currentSize': 0, 'totalPreCompressionSize': 0, 'compressionProgress': 0, 'progress': 0,
|
||||
'rate': 0, 'hasImage': false, 'hasVideo': false, 'attachmentsCount': 0, id: value6.id, items: undefined};
|
||||
return value6;
|
||||
}
|
||||
|
||||
function value_57874() { // fn#57874, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:2862, offset: 0x016b85e2, size: 32 bytes, params: 1, frame: 13
|
||||
return this.files.reduce(function(a0, {currentSize}) {
|
||||
return a0 + (currentSize ?? 0);
|
||||
}, 0);
|
||||
}
|
||||
|
||||
function* _fun57877() { // fn#57877, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:3002, offset: 0x016b862b, size: 775 bytes, params: 1, frame: 34
|
||||
var r5;
|
||||
var r19;
|
||||
var r1;
|
||||
var object3;
|
||||
var concat;
|
||||
var reactNativeCompressAndExtractData;
|
||||
var value12;
|
||||
var value13;
|
||||
var value14;
|
||||
var isCancelled;
|
||||
var isCancelled2;
|
||||
var currentSize;
|
||||
var value15;
|
||||
var value16;
|
||||
var binding2;
|
||||
var value17;
|
||||
var getEffectiveKestrelLimit;
|
||||
var getMaxFileSize;
|
||||
var channelId;
|
||||
var value18;
|
||||
var value19;
|
||||
var value20;
|
||||
var value21;
|
||||
var _handleError;
|
||||
var ENTITY_TOO_LARGE;
|
||||
var object4;
|
||||
var POSTCOMPRESSION_INDIVIDUAL_FILE_TOO_LARGE;
|
||||
var ENTITY_EMPTY;
|
||||
var value22;
|
||||
var value23;
|
||||
var error;
|
||||
var _handleException;
|
||||
var _fileSize;
|
||||
var getMaxTotalAttachmentSize;
|
||||
var POSTCOMPRESSION_SUM_TOO_LARGE;
|
||||
if (false) {
|
||||
return undefined;
|
||||
}
|
||||
value = undefined;
|
||||
let binding = env2_0;
|
||||
const value4 = binding(env2_2[11]);
|
||||
const getUploadTarget = value4.getUploadTarget;
|
||||
const files = this.files;
|
||||
const value5 = 0;
|
||||
let property = files[value5];
|
||||
const value6 = Reflect.apply(getUploadTarget, value4,
|
||||
[property == null || property.item == null ? value : property.item.target]);
|
||||
const length = this.files.length;
|
||||
const getMaxAttachmentsCount = value6.getMaxAttachmentsCount;
|
||||
if (length > Reflect.apply(getMaxAttachmentsCount, value6, [])) {
|
||||
binding = env2_11;
|
||||
binding.log('Too many attachments for ' + this.id);
|
||||
this._handleError({code: env2_9.TOO_MANY_ATTACHMENTS});
|
||||
return false;
|
||||
}
|
||||
const kestrelConfig = env2_0(env2_2[12]).getKestrelConfig({location: 'UploaderBase.compressAndCheckFileSize'});
|
||||
binding = env2_11;
|
||||
let log = binding.log;
|
||||
let id = this.id;
|
||||
let HermesInternal = global.HermesInternal;
|
||||
Reflect.apply(log, binding, ['compressing files for ' + id]);
|
||||
const value9 = env2_12(this.files);
|
||||
const value10 = value9();
|
||||
let done = value10.done;
|
||||
if (done) {
|
||||
value = this._fileSize();
|
||||
value = value > value6.getMaxTotalAttachmentSize();
|
||||
if (value) {
|
||||
this._handleError({code: env2_9.ENTITY_TOO_LARGE, reason: {type: env2_10.POSTCOMPRESSION_SUM_TOO_LARGE}});
|
||||
r1 = 1;
|
||||
} else {
|
||||
r1 = value;
|
||||
}
|
||||
return !r1;
|
||||
}
|
||||
let r13 = value10;
|
||||
let value11 = r13.value;
|
||||
reducibleLoop7: while (true) {
|
||||
try {
|
||||
reactNativeCompressAndExtractData = value11.reactNativeCompressAndExtractData;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
value12 = Reflect.apply(reactNativeCompressAndExtractData, value11, []);
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
yield value12;
|
||||
try {
|
||||
value13 = undefined;
|
||||
value14 = false;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
if (value14) {
|
||||
return value13;
|
||||
}
|
||||
try {
|
||||
isCancelled = value11.isCancelled;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
isCancelled2 = Reflect.apply(isCancelled, value11, []);
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
if (isCancelled2) {
|
||||
try {
|
||||
binding = env2_11;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
log = binding.log;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
id = value11.id;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
HermesInternal = global.HermesInternal;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
concat = HermesInternal.concat;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
value22 = 'compressAndCheckFileSize() file has been cancelled for compression - ' + id;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
Reflect.apply(log, binding, [value22]);
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
currentSize = value11.currentSize;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
value15 = currentSize != null;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
reducibleJoin23: while (true) {
|
||||
if (value15) {
|
||||
r5 = currentSize;
|
||||
break reducibleJoin23;
|
||||
}
|
||||
r5 = value5;
|
||||
break reducibleJoin23;
|
||||
}
|
||||
try {
|
||||
value16 = value5 === r5;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
if (value16) {
|
||||
try {
|
||||
_handleError = this._handleError;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
object3 = {};
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
binding = env2_9;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
ENTITY_EMPTY = binding.ENTITY_EMPTY;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
object3.code = ENTITY_EMPTY;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
Reflect.apply(_handleError, this, [object3]);
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
binding = env2_0;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
binding2 = env2_2;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
property = binding2[12];
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
value17 = binding(property);
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
getEffectiveKestrelLimit = value17.getEffectiveKestrelLimit;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
getMaxFileSize = value6.getMaxFileSize;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
channelId = value11.channelId;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
value18 = Reflect.apply(getMaxFileSize, value6, [channelId]);
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
value19 = Reflect.apply(getEffectiveKestrelLimit, value17, [kestrelConfig, value18]);
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
currentSize = value11.currentSize;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
value20 = currentSize != null;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
reducibleJoin40: while (true) {
|
||||
if (value20) {
|
||||
r19 = currentSize;
|
||||
break reducibleJoin40;
|
||||
}
|
||||
r19 = value5;
|
||||
break reducibleJoin40;
|
||||
}
|
||||
try {
|
||||
value21 = r19 > value19;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
reducibleJoin69: while (true) {
|
||||
if (value21) {
|
||||
try {
|
||||
_handleError = this._handleError;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
object3 = {};
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
binding = env2_9;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
ENTITY_TOO_LARGE = binding.ENTITY_TOO_LARGE;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
object3.code = ENTITY_TOO_LARGE;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
object4 = {};
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
binding = env2_10;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
POSTCOMPRESSION_INDIVIDUAL_FILE_TOO_LARGE = binding.POSTCOMPRESSION_INDIVIDUAL_FILE_TOO_LARGE;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
object4.type = POSTCOMPRESSION_INDIVIDUAL_FILE_TOO_LARGE;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
object3.reason = object4;
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
Reflect.apply(_handleError, this, [object3]);
|
||||
} catch (error) {
|
||||
_handleException = this._handleException;
|
||||
Reflect.apply(_handleException, this, [error]);
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
break reducibleJoin69;
|
||||
}
|
||||
}
|
||||
value23 = value9();
|
||||
done = value23.done;
|
||||
if (done) {
|
||||
_fileSize = this._fileSize;
|
||||
value = Reflect.apply(_fileSize, this, []);
|
||||
getMaxTotalAttachmentSize = value6.getMaxTotalAttachmentSize;
|
||||
value = value > Reflect.apply(getMaxTotalAttachmentSize, value6, []);
|
||||
reducibleJoin74: while (true) {
|
||||
if (value) {
|
||||
_handleError = this._handleError;
|
||||
ENTITY_TOO_LARGE = env2_9.ENTITY_TOO_LARGE;
|
||||
POSTCOMPRESSION_SUM_TOO_LARGE = env2_10.POSTCOMPRESSION_SUM_TOO_LARGE;
|
||||
Reflect.apply(_handleError, this, [{code: ENTITY_TOO_LARGE,
|
||||
reason: {type: POSTCOMPRESSION_SUM_TOO_LARGE}}]);
|
||||
value = 1;
|
||||
r1 = value;
|
||||
break reducibleJoin74;
|
||||
}
|
||||
r1 = value;
|
||||
break reducibleJoin74;
|
||||
}
|
||||
return !r1;
|
||||
}
|
||||
r13 = value23;
|
||||
value11 = r13.value;
|
||||
continue reducibleLoop7;
|
||||
}
|
||||
}
|
||||
|
||||
function value_57879() { // fn#57879, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:4258, offset: 0x016b8932, size: 229 bytes, params: 1, frame: 24
|
||||
const value = this.files.some(function(a0) {
|
||||
return a0.isImage;
|
||||
});
|
||||
const value2 = this.files.some(function(a0) {
|
||||
return a0.isVideo;
|
||||
});
|
||||
const value3 = this._fileSize();
|
||||
const binding = env1_11;
|
||||
const log = binding.log;
|
||||
const length = this.files.length;
|
||||
Reflect.apply(log, binding,
|
||||
['setUploadingTextForUI - total content: ' + value3 + ' bytes and ' + length + ' attachments for ' + this.id]);
|
||||
const object2 = {};
|
||||
copyDataProperties(object2, this._file, length);
|
||||
object2['totalPostCompressionSize'] = value3;
|
||||
object2['currentSize'] = value3;
|
||||
object2['hasVideo'] = value2;
|
||||
object2['hasImage'] = value;
|
||||
object2['attachmentsCount'] = this.files.length;
|
||||
object2['items'] = this.files;
|
||||
this._file = object2;
|
||||
}
|
||||
|
||||
function value_57883() { // fn#57883, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:4817, offset: 0x016b8a65, size: 54 bytes, params: 1, frame: 15
|
||||
const value = this._fileSize();
|
||||
const object2 = {};
|
||||
object2.loaded = this.files.reduce(function(a0, {loaded}) {
|
||||
return a0 + (loaded ?? 0);
|
||||
}, 0);
|
||||
object2.total = value;
|
||||
return object2;
|
||||
}
|
||||
|
||||
function value_57885() { // fn#57885, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:4985, offset: 0x016b8abb, size: 34 bytes, params: 1, frame: 12
|
||||
this.files.forEach(_fun57886);
|
||||
return {};
|
||||
}
|
||||
|
||||
function value_57887(a0, a1, a2) { // fn#57887, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:5140, offset: 0x016b8b23, size: 102 bytes, params: 4, frame: 19
|
||||
const object2 = {};
|
||||
copyDataProperties(object2, a0, undefined);
|
||||
let value = environment.__proto__;
|
||||
value = importDefault(22) /* metro dependency 22 */;
|
||||
const value2 = value.get(object2, a1, []);
|
||||
const items2 = [];
|
||||
arraySpread(items2, a2, arraySpread(items2, value2, 0, value), value);
|
||||
return (importDefault(22) /* metro dependency 22 */).set(object2, a1, items2);
|
||||
}
|
||||
|
||||
function value_57889() { // fn#57889, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:5450, offset: 0x016b8bb7, size: 126 bytes, params: 1, frame: 14
|
||||
var _cancel;
|
||||
const binding = env1_11;
|
||||
binding.log('cancel() for ' + this.id);
|
||||
if (!this._aborted) {
|
||||
this._aborted = true;
|
||||
_cancel = this._cancel;
|
||||
if (_cancel != null) {
|
||||
_cancel.call(this);
|
||||
}
|
||||
this.files.forEach(function(a0) {
|
||||
return a0.cancel();
|
||||
});
|
||||
this._handleComplete();
|
||||
}
|
||||
}
|
||||
|
||||
function* _fun57892(a0) { // fn#57892, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:5662, offset: 0x016b8c4d, size: 360 bytes, params: 2, frame: 21
|
||||
var environment;
|
||||
if (true) {
|
||||
var env0_0 = a0;
|
||||
value = environment.__proto__.__proto__;
|
||||
var binding = env2_11;
|
||||
binding.log('Cancel called for ' + this.id + ' for item ' + a0);
|
||||
var files = this.files;
|
||||
var value3 = files.find(_fun57893);
|
||||
if (value3 != null) {
|
||||
if (value3.isCancelled()) {
|
||||
return undefined;
|
||||
}
|
||||
files = this.files;
|
||||
var value4 = files.indexOf(value3);
|
||||
files = this.files;
|
||||
var slice = files.slice;
|
||||
var value5 = Reflect.apply(slice, files, [0, value4]);
|
||||
var object = [];
|
||||
var value6 = arraySpread(object, value5, 0, value4);
|
||||
files = this.files;
|
||||
slice = files.slice;
|
||||
arraySpread(object, Reflect.apply(slice, files, [value4 + 1]), value6, value4);
|
||||
this.files = object;
|
||||
object = {};
|
||||
var _file = this._file;
|
||||
copyDataProperties(object, _file, value6);
|
||||
files = this.files;
|
||||
object['items'] = files;
|
||||
this._file = object;
|
||||
value = env2_0(env2_2[13]);
|
||||
yield value.cancelGetAttachmentFile(value3);
|
||||
value = undefined;
|
||||
if (false) {
|
||||
return value;
|
||||
}
|
||||
value3.cancel();
|
||||
var emit = this.emit;
|
||||
_file = this._file;
|
||||
Reflect.apply(emit, this, ['cancel-upload-item', _file]);
|
||||
files = this.files;
|
||||
if (files.length === 0) {
|
||||
this.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function _handleStart(a0) { // fn#57867, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:1683, owner: UploaderBase._handleStart, offset: 0x016b830b, size: 67 bytes, params: 2, frame: 14
|
||||
let binding = env0_0;
|
||||
binding._cancel = a0;
|
||||
if (!binding.alreadyStarted) {
|
||||
binding = env0_0;
|
||||
binding.emit('start', binding._file);
|
||||
}
|
||||
env0_0.alreadyStarted = true;
|
||||
}
|
||||
|
||||
function _handleProgress(a0, a1, a2) { // fn#57868, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:1780, owner: UploaderBase._handleProgress, offset: 0x016b834e, size: 252 bytes, params: 4, frame: 22
|
||||
var items2;
|
||||
const env0_0 = a2;
|
||||
const Date = global.Date;
|
||||
const value = Date.now();
|
||||
const value3 = (require(4658) /* metro dependency 4658: UploadUtils */).calculateProgress(a0, a1);
|
||||
const Math = global.Math;
|
||||
const floor = Math.floor;
|
||||
let binding = env0_0;
|
||||
const value5 = a0 - binding._loaded;
|
||||
const value6 = value - binding._lastUpdate;
|
||||
const value7 = Reflect.apply(floor, Math, [value5 / (value6 / 1000)]);
|
||||
if (a2 != null) {
|
||||
items2 = env0_0._file.items;
|
||||
if (items2 != null) {
|
||||
items2.forEach(function(a0) {
|
||||
a0.item.progress = importDefault[a0.id];
|
||||
});
|
||||
}
|
||||
}
|
||||
binding = env0_0;
|
||||
binding._lastUpdate = value;
|
||||
binding._loaded = a0;
|
||||
const object2 = {};
|
||||
copyDataProperties(object2, binding._file, value6);
|
||||
object2['currentSize'] = a1;
|
||||
object2['progress'] = value3;
|
||||
object2['rate'] = value7;
|
||||
binding._file = object2;
|
||||
binding.emit('progress', binding._file);
|
||||
}
|
||||
|
||||
function _handleException(a0) { // fn#57870, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:2101, owner: UploaderBase._handleException, offset: 0x016b846c, size: 65 bytes, params: 2, frame: 14
|
||||
const binding = env0_0;
|
||||
const _handleError = binding._handleError;
|
||||
const object = {};
|
||||
const ERROR_SOURCE_UNKNOWN = FileUploadErrorTypes.ERROR_SOURCE_UNKNOWN;
|
||||
object.type = ERROR_SOURCE_UNKNOWN;
|
||||
object.msg = a0.toString();
|
||||
Reflect.apply(_handleError, binding, [{reason: object}]);
|
||||
}
|
||||
|
||||
function _handleAborted() { // fn#57871, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:2195, owner: UploaderBase._handleAborted, offset: 0x016b84ad, size: 21 bytes, params: 1, frame: 9
|
||||
env0_0.clearProcessingMessageInterval();
|
||||
}
|
||||
|
||||
function _handleError({code, reason, body}) { // fn#57872, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:2251, owner: UploaderBase._handleError, offset: 0x016b84c2, size: 184 bytes, params: 2, frame: 24
|
||||
var binding2;
|
||||
var log;
|
||||
var value;
|
||||
let binding = env0_0;
|
||||
binding.clearProcessingMessageInterval();
|
||||
if (!binding._aborted) {
|
||||
binding = env0_0;
|
||||
binding._errored = true;
|
||||
value = environment.__proto__.__proto__;
|
||||
binding2 = env2_11;
|
||||
log = binding2.log;
|
||||
value = global.JSON.stringify(reason);
|
||||
Reflect.apply(log, binding2, ['_handleError: ' + code + ' (' + value + ') for ' + binding.id]);
|
||||
binding.emit('error', binding._file, code, body, reason);
|
||||
binding.removeAllListeners();
|
||||
}
|
||||
}
|
||||
|
||||
function _handleComplete(a0) { // fn#57873, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:2478, owner: UploaderBase._handleComplete, offset: 0x016b857a, size: 104 bytes, params: 2, frame: 16
|
||||
const binding = env0_0;
|
||||
binding.clearProcessingMessageInterval();
|
||||
const binding2 = env2_11;
|
||||
binding2.log('_handleComplete for ' + binding.id);
|
||||
binding.emit('complete', binding._file, a0);
|
||||
binding.removeAllListeners();
|
||||
}
|
||||
|
||||
function _fun57886({id, loaded, currentSize}) { // fn#57886, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:5032, offset: 0x016b8add, size: 70 bytes, params: 2, frame: 16
|
||||
const binding = env0_0;
|
||||
let value = environment.__proto__.__proto__;
|
||||
value = require(4658) /* metro dependency 4658: UploadUtils */;
|
||||
binding[id] = value.calculateProgress(loaded, currentSize);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user