133 lines
6.3 KiB
TypeScript
133 lines
6.3 KiB
TypeScript
/* Metro module 4650; source: lib/uploader/Upload.tsx; dependencies: [6, 7, 15, 17, 18, 4651, 22, 4655, 491, 639, 2] */
|
|
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
|
|
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
|
|
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as Module00639Module from '../../by-id/module-00639.js'; /* Metro dependency 639 */
|
|
|
|
function _fun40122(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#40122, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4828:6, offset: 0x010f6cfc, size: 320 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
object = {REACT_NATIVE: 0};
|
|
object[0] = 'REACT_NATIVE';
|
|
object.WEB = 1;
|
|
object[1] = 'WEB';
|
|
const object2 = {FILE_ATTACHMENT: 0};
|
|
object2[0] = 'FILE_ATTACHMENT';
|
|
object2.IMAGE_PICKER = 1;
|
|
object2[1] = 'IMAGE_PICKER';
|
|
object2.IMAGE_EDITOR = 2;
|
|
object2[2] = 'IMAGE_EDITOR';
|
|
const EventEmitter = (Module00639Module).EventEmitter;
|
|
const value = _fun40126(EventEmitter);
|
|
(FileImportTrackerModule).fileFinishedImporting('lib/uploader/Upload.tsx');
|
|
exports.default = value;
|
|
exports.UploadPlatform = object;
|
|
exports.isResolvedUpload = function(a0) {
|
|
return a0.isVideo !== undefined && a0.isImage !== undefined;
|
|
};
|
|
exports.UploadOrigin = object2;
|
|
function _isNativeReflectConstruct_40123() { // fn#40123, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4828:148, offset: 0x010f6e3c, 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_40123_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun40126(a0) { // fn#40126, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4828:570, offset: 0x010f6e9a, size: 91 bytes, params: 2, frame: 16
|
|
const Upload2 = Upload;
|
|
Inherits(Upload2, a0);
|
|
return CreateClass(Upload2, [{key: 'cancel', value: function() {
|
|
}}, {key: 'resetState', value: function() {
|
|
return this;
|
|
}}]);
|
|
function Upload(a0) { // fn#40127, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4828:582, offset: 0x010f6ef5, size: 579 bytes, params: 2, frame: 21
|
|
var moduleValue;
|
|
var classifyFile;
|
|
var file;
|
|
var classification;
|
|
var moduleValue2;
|
|
var getFile;
|
|
var filename;
|
|
var value8;
|
|
const value = environment.__proto__;
|
|
env1_4(this, Upload);
|
|
const value3 = env1_7(Upload);
|
|
const value6 = env1_6(this, _isNativeReflectConstruct_40123() ? global.Reflect.construct(value3, [],
|
|
env1_7(this).constructor) : value3.apply(this, undefined));
|
|
value6.allowOptimization = true;
|
|
value6.item = a0;
|
|
const platform = a0.platform;
|
|
const REACT_NATIVE = env1_9.REACT_NATIVE;
|
|
if (platform === REACT_NATIVE) {
|
|
value6.id = a0.id ?? a0.uri;
|
|
moduleValue2 = require(4651) /* metro dependency 4651: UploadUtils */;
|
|
getFile = moduleValue2.getFile;
|
|
filename = a0.filename;
|
|
value8 = Reflect.apply(getFile, moduleValue2, [{uri: a0.uri, overrideFilename: filename,
|
|
overrideType: a0.mimeType}]);
|
|
filename = value8.filename;
|
|
value6.filename = filename;
|
|
value6.isImage = value8.isImage;
|
|
value6.isVideo = value8.isVideo;
|
|
value6.mimeType = value8.type;
|
|
value6.origin = a0.origin;
|
|
value6.durationSecs = a0.durationSecs;
|
|
value6.waveform = a0.waveform;
|
|
} else {
|
|
value6.id = a0.id ?? (importDefault(22) /* metro dependency 22 */).uniqueId('upload');
|
|
moduleValue = importAll(4655) /* metro dependency 4655: FileUtils */;
|
|
classifyFile = moduleValue.classifyFile;
|
|
file = a0.file;
|
|
value6.classification = Reflect.apply(classifyFile, moduleValue, [file]);
|
|
classification = value6.classification;
|
|
value6.isImage = classification === 'image';
|
|
classification = value6.classification;
|
|
value6.isVideo = classification === 'video';
|
|
file = a0.file;
|
|
value6.filename = file.name;
|
|
file = a0.file;
|
|
value6.mimeType = file.type;
|
|
value6.origin = a0.origin;
|
|
}
|
|
value6.isThumbnail = a0.isThumbnail;
|
|
value6.clip = a0.clip;
|
|
value6.uniqueId = (require(491) /* metro dependency 491 */).v4();
|
|
value6.spoiler = false;
|
|
value6.description = null;
|
|
return value6;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun40122, 4650, [6, 7, 15, 17, 18, 4651, 22, 4655, 491, 639,
|
|
2]) /* metro module 4650, dependencies: [6, 7, 15, 17, 18, 4651, 22, 4655, 491, 639, 2] */;
|