382 lines
22 KiB
TypeScript
382 lines
22 KiB
TypeScript
/* Metro module 11483; source: modules/safety_hub/native/ClassificationMessageEvidence.tsx; dependencies: [57, 31, 27, 1310, 1878, 11473, 5267, 661, 33, 8177, 4501, 566, 4002, 11484, 11485, 5266, 4631, 9544, 8011, 9869, 9773, 4625, 21, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import ThemeStore from '../../user_settings/ThemeStore.tsx'; /* Metro dependency 1310 */
|
|
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import Module08011 from '../../../by-id/module-08011.jsx'; /* Metro dependency 8011 */
|
|
import SafetyHubStore from '../SafetyHubStore.tsx'; /* Metro dependency 11473 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as MediaFormatTestersModule from '../../messages/MediaFormatTesters.tsx'; /* Metro dependency 4631 */
|
|
import * as OpenMediaModalModule from '../../media_viewer/native/components/openMediaModal.tsx'; /* Metro dependency 9544 */
|
|
|
|
function _fun87966(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#87966, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:6, offset: 0x01fcff0a, size: 429 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactNativeModule;
|
|
const env0_5 = value.View;
|
|
const env0_6 = value.findNodeHandle;
|
|
const env0_7 = value.Image;
|
|
const env0_8 = value.ActivityIndicator;
|
|
value = require(5267) /* metro dependency 5267: SafetyHubConstants */;
|
|
const env0_12 = value.DEFAULT_MEDIA_MAX_WIDTH;
|
|
const env0_13 = value.DEFAULT_MEDIA_MAX_HEIGHT;
|
|
const env0_14 = value.VIDEO_PLACEHOLDER_WIDTH;
|
|
const env0_15 = value.VIDEO_PLACEHOLDER_HEIGHT;
|
|
const env0_16 = value.VIDEO_PLACEHOLDER_FILENAME;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_18 = value.jsx;
|
|
const env0_19 = value.jsxs;
|
|
value = importDefault(8177) /* metro dependency 8177: RowGenerator */;
|
|
value = new value();
|
|
const env0_21 = (CreateStylesModule).createStyles({dummyVideoAttachments: {'width': 0,
|
|
'height': 0}});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/safety_hub/native/ClassificationMessageEvidence.tsx');
|
|
exports.default = ClassificationEvidence_87967;
|
|
function ClassificationEvidence_87967({flaggedContent}) { // fn#87967, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:615, offset: 0x01fd00b7, size: 1006 bytes, params: 2, frame: 34
|
|
var object3;
|
|
var r0;
|
|
var items3;
|
|
var defaultImport2;
|
|
var object4;
|
|
var moduleValue4;
|
|
var createMessageRecord;
|
|
var object6;
|
|
var Date;
|
|
var defaultImport3;
|
|
var extractTimestamp;
|
|
var value14;
|
|
var value15;
|
|
var date;
|
|
var items2;
|
|
const styles = useStyles();
|
|
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
|
|
return UserStore.getCurrentUser();
|
|
});
|
|
let binding = env0_4;
|
|
const value3 = binding.useRef(null);
|
|
let useState = binding.useState;
|
|
const value4 = Reflect.apply(useState, binding, [null]);
|
|
const binding2 = property22;
|
|
const value5 = binding2(value4, 2);
|
|
const property = value5[0];
|
|
const env0_2 = value5[1];
|
|
useState = binding.useState;
|
|
const value6 = binding2(Reflect.apply(useState, binding, [{}]), 2);
|
|
const property2 = value6[0];
|
|
var property22 = property2;
|
|
var env0_4 = value6[1];
|
|
const value7 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ThemeStore], function() {
|
|
return require(dependencyMap[12]).isThemeLight(ThemeStore.theme);
|
|
});
|
|
const resolveAssetSource = Image.resolveAssetSource;
|
|
const r2 = value7 ? Reflect.apply(resolveAssetSource, Image,
|
|
[importDefault(11484) /* metro dependency 11484 */]) : Reflect.apply(resolveAssetSource, Image,
|
|
[importDefault(11485) /* metro dependency 11485 */]);
|
|
const property3 = flaggedContent[0];
|
|
binding = env0_4;
|
|
useState = binding.useState;
|
|
const value9 = property22(Reflect.apply(useState, binding, [property3.attachments.length]), 2);
|
|
const property4 = value9[0];
|
|
const env0_8 = value9[1];
|
|
const username = (require(566) /* metro dependency 566: flux */).useStateFromStores([SafetyHubStore], function() {
|
|
return SafetyHubStore.getUsername();
|
|
});
|
|
let id = property3.id;
|
|
const value10 = binding.useMemo(_fun87971, [property3.attachments, property2, r2]);
|
|
const value11 = binding.useCallback(_fun87973, [value10, property3.attachments, id, property2, r2]);
|
|
const value12 = binding.useCallback(_fun87975, [property]);
|
|
binding.useEffect(_fun87976, [property3.attachments]);
|
|
binding.useEffect(_fun87986, [property4]);
|
|
if (property3.content !== '') {
|
|
if (property4 > 0) {
|
|
items2 = [
|
|
<ActivityIndicator />,
|
|
];
|
|
items2[1] = (
|
|
<View style={styles.dummyVideoAttachments}>
|
|
{property3.attachments.filter(_fun87987).map(_fun87988)}
|
|
</View>
|
|
);
|
|
object3 = {children: items2};
|
|
} else {
|
|
items3 = [
|
|
((Component) => <Component ref={value3} onTapImage={value11} inverted={false} />)(importDefault(9869) /* metro dependency 9869: ChatAndroid */),
|
|
|
|
|
|
|
|
];
|
|
defaultImport2 = importDefault(9773) /* metro dependency 9773: ChatItem */;
|
|
object4 = {rowGenerator: env0_20};
|
|
moduleValue4 = require(4625) /* metro dependency 4625: MessageRecordUtils */;
|
|
createMessageRecord = moduleValue4.createMessageRecord;
|
|
object6 = {};
|
|
id = property3.id;
|
|
object6.id = id;
|
|
Date = global.Date;
|
|
defaultImport3 = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
extractTimestamp = defaultImport3.extractTimestamp;
|
|
id = property3.id;
|
|
value14 = Reflect.apply(extractTimestamp, defaultImport3, [id]);
|
|
value15 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
date = new Date();
|
|
object6.timestamp = (date instanceof Object ? date : value15).toUTCString();
|
|
object6.channel_id = '1';
|
|
object6.type = MessageTypes.DEFAULT;
|
|
object6.author = currentUser ?? ({'id': '0', 'avatar': null, 'discriminator': '0000', username: username});
|
|
object6.content = property3.content;
|
|
object6.attachments = value10;
|
|
object4.message = Reflect.apply(createMessageRecord, moduleValue4, [object6]);
|
|
object4.modifyRow = value12;
|
|
items3[1] = ((Component) => <Component {...object4} />)(defaultImport2);
|
|
object3 = {children: items3};
|
|
}
|
|
r0 = <View {...object3} />;
|
|
} else if (property3.attachments.length === 0) {
|
|
r0 = null;
|
|
} else {
|
|
if (property4 > 0) {
|
|
items2 = [
|
|
<ActivityIndicator />,
|
|
];
|
|
items2[1] = (
|
|
<View style={styles.dummyVideoAttachments}>
|
|
{property3.attachments.filter(_fun87987).map(_fun87988)}
|
|
</View>
|
|
);
|
|
object3 = {children: items2};
|
|
} else {
|
|
items3 = [
|
|
((Component) => <Component ref={value3} onTapImage={value11} inverted={false} />)(importDefault(9869) /* metro dependency 9869: ChatAndroid */),
|
|
|
|
|
|
|
|
];
|
|
defaultImport2 = importDefault(9773) /* metro dependency 9773: ChatItem */;
|
|
object4 = {rowGenerator: env0_20};
|
|
moduleValue4 = require(4625) /* metro dependency 4625: MessageRecordUtils */;
|
|
createMessageRecord = moduleValue4.createMessageRecord;
|
|
object6 = {};
|
|
id = property3.id;
|
|
object6.id = id;
|
|
Date = global.Date;
|
|
defaultImport3 = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
extractTimestamp = defaultImport3.extractTimestamp;
|
|
id = property3.id;
|
|
value14 = Reflect.apply(extractTimestamp, defaultImport3, [id]);
|
|
value15 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
date = new Date();
|
|
object6.timestamp = (date instanceof Object ? date : value15).toUTCString();
|
|
object6.channel_id = '1';
|
|
object6.type = MessageTypes.DEFAULT;
|
|
object6.author = currentUser ?? ({'id': '0', 'avatar': null, 'discriminator': '0000', username: username});
|
|
object6.content = property3.content;
|
|
object6.attachments = value10;
|
|
object4.message = Reflect.apply(createMessageRecord, moduleValue4, [object6]);
|
|
object4.modifyRow = value12;
|
|
items3[1] = ((Component) => <Component {...object4} />)(defaultImport2);
|
|
object3 = {children: items3};
|
|
}
|
|
r0 = <View {...object3} />;
|
|
}
|
|
return r0;
|
|
function _fun87971() { // fn#87971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:1114, offset: 0x01fd04ea, size: 34 bytes, params: 1, frame: 11
|
|
return env0_6.attachments.map(_fun87972);
|
|
function _fun87972(a0) { // fn#87972, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:1137, offset: 0x01fd050c, size: 336 bytes, params: 2, frame: 19
|
|
var r0;
|
|
var moduleValue3;
|
|
var object;
|
|
var value4;
|
|
var object2;
|
|
var value5;
|
|
var binding;
|
|
var id;
|
|
var property;
|
|
const object3 = {};
|
|
copyDataProperties(object3, a0, undefined);
|
|
const value2 = undefined;
|
|
object3['filename'] = (require(5266) /* metro dependency 5266: SafetyHubUtils */).getAttachmentFilename(a0);
|
|
object3['size'] = 0;
|
|
object3['proxy_url'] = a0.url;
|
|
if (MediaFormatTestersModule.isImageFile(a0.filename)) {
|
|
object2 = {};
|
|
copyDataProperties(object2, object3, MediaFormatTestersModule);
|
|
value5 = environment.__proto__;
|
|
binding = env1_3;
|
|
id = a0.id;
|
|
property = binding[id];
|
|
object2['width'] = (property == null ? value2 : property.width) ?? DEFAULT_MEDIA_MAX_WIDTH;
|
|
binding = env1_3;
|
|
id = a0.id;
|
|
property = binding[id];
|
|
object2['height'] = (property == null ? value2 : property.height) ?? DEFAULT_MEDIA_MAX_HEIGHT;
|
|
r0 = object2;
|
|
} else {
|
|
moduleValue3 = MediaFormatTestersModule;
|
|
if (moduleValue3.isVideoFile(a0.filename)) {
|
|
object = {};
|
|
copyDataProperties(object, object3, MediaFormatTestersModule);
|
|
object['width'] = VIDEO_PLACEHOLDER_WIDTH;
|
|
object['height'] = VIDEO_PLACEHOLDER_HEIGHT;
|
|
value4 = environment.__proto__;
|
|
object['proxy_url'] = env1_5.uri;
|
|
object['filename'] = VIDEO_PLACEHOLDER_FILENAME;
|
|
r0 = object;
|
|
} else {
|
|
r0 = object3;
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
}
|
|
|
|
function _fun87973({nativeEvent}) { // fn#87973, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:1511, offset: 0x01fd065c, size: 115 bytes, params: 2, frame: 15
|
|
(OpenMediaModalModule).openMediaModal({'initialIndex': null,
|
|
'initialSources': null, 'disableDownload': true, 'disableMediaOverlayButton': true, 'shareable': false,
|
|
initialIndex: nativeEvent.index, initialSources: env0_10.map(_fun87974),
|
|
originViewOrOriginLayout: nativeEvent.layout});
|
|
function _fun87974(a0, a1) { // fn#87974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:1565, offset: 0x01fd06cf, size: 307 bytes, params: 3, frame: 18
|
|
const object = {};
|
|
object.uri = a0.url;
|
|
const value2 = undefined;
|
|
object.videoURI = MediaFormatTestersModule.isVideoFile(env1_6.attachments[a1].filename) ? a0.url : value2;
|
|
object.thumbnail = MediaFormatTestersModule.isVideoFile(env1_6.attachments[a1].filename) ? {width: VIDEO_PLACEHOLDER_WIDTH,
|
|
height: VIDEO_PLACEHOLDER_HEIGHT, uri: env1_5.uri} : value2;
|
|
object.mediaIndex = a1;
|
|
object.channelId = '1';
|
|
object.messageId = id;
|
|
let property = env1_3[a0.id];
|
|
object.width = (property == null ? value2 : property.width) ?? DEFAULT_MEDIA_MAX_WIDTH;
|
|
property = env1_3[a0.id];
|
|
object.height = (property == null ? value2 : property.height) ?? DEFAULT_MEDIA_MAX_HEIGHT;
|
|
object.accessoryType = 'attachment';
|
|
object.attachmentId = a0.id;
|
|
return object;
|
|
}
|
|
|
|
}
|
|
|
|
function _fun87975(a0) { // fn#87975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2153, offset: 0x01fd0802, size: 20 bytes, params: 2, frame: 2
|
|
a0.reactTag = env0_1;
|
|
}
|
|
|
|
function _fun87976() { // fn#87976, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2197, offset: 0x01fd0816, size: 53 bytes, params: 1, frame: 12
|
|
env0_6.attachments.filter(_fun87977).map(function(a0) {
|
|
var env0_0 = a0;
|
|
var value = _fun87979(a0);
|
|
value = value.then(_fun87982);
|
|
return value.finally(_fun87984);
|
|
});
|
|
function _fun87977({filename}) { // fn#87977, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2224, offset: 0x01fd084b, size: 47 bytes, params: 2, frame: 12
|
|
const value = environment.__proto__.__proto__;
|
|
return (MediaFormatTestersModule).isImageFile(filename);
|
|
}
|
|
|
|
function _fun87978(a0) { // fn#87978, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2271, offset: 0x01fd087a, size: 60 bytes, params: 2, frame: 12
|
|
let env0_0 = a0;
|
|
let value = ((a0) => {
|
|
var env0_0 = a0;
|
|
var Promise = global.Promise;
|
|
var value = Object.create(Promise.prototype, {constructor: {value: Promise}});
|
|
var value2 = new Promise(_fun87980);
|
|
return value2 instanceof Object ? value2 : value;
|
|
})(a0);
|
|
value = value.then(_fun87982);
|
|
return value.finally(_fun87984);
|
|
function getImageAttachmentDimensions(a0) { // fn#87979, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2274, offset: 0x01fd08b6, size: 46 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(function(a0, a1) {
|
|
return Image.getSize(a0.url, _fun87981, a1);
|
|
});
|
|
return promise instanceof Object ? promise : value;
|
|
function _fun87980(a0, a1) { // fn#87980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2335, offset: 0x01fd08e4, size: 53 bytes, params: 3, frame: 15
|
|
return Image.getSize(a0.url, _fun87981, a1);
|
|
function _fun87981(a0, a1) { // fn#87981, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2359, offset: 0x010fe3f4, size: 32 bytes, params: 3, frame: 11
|
|
return env0_0({width: a0, height: a1});
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _fun87982(a0) { // fn#87982, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2404, offset: 0x01fd0919, size: 32 bytes, params: 2, frame: 11
|
|
const env0_0 = a0;
|
|
return env2_4(_fun87983);
|
|
function _fun87983(a0) { // fn#87983, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2410, offset: 0x01bffd18, size: 38 bytes, params: 2, frame: 12
|
|
const object = {};
|
|
copyDataProperties(object, a0, undefined);
|
|
object[env1_0.id] = env0_0;
|
|
return object;
|
|
}
|
|
|
|
}
|
|
|
|
function _fun87984() { // fn#87984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2444, offset: 0x01fd0939, size: 25 bytes, params: 1, frame: 11
|
|
return env2_8(function(a0) {
|
|
return a0 - 1;
|
|
});
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _fun87986() { // fn#87986, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2496, offset: 0x01fd0952, size: 49 bytes, params: 1, frame: 12
|
|
var binding;
|
|
var value2;
|
|
if (env0_7 === 0) {
|
|
binding = env0_2;
|
|
value2 = environment.__proto__;
|
|
binding(findNodeHandle(env0_0.current));
|
|
}
|
|
}
|
|
|
|
function _fun87987({filename}) { // fn#87987, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2670, offset: 0x01fd0983, size: 47 bytes, params: 2, frame: 12
|
|
const value = environment.__proto__;
|
|
return (MediaFormatTestersModule).isVideoFile(filename);
|
|
}
|
|
|
|
function _fun87988(a0, a1) { // fn#87988, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2717, offset: 0x01fd09b2, size: 91 bytes, params: 3, frame: 17
|
|
var environment;
|
|
const env0_0 = a0;
|
|
const value = environment.__proto__;
|
|
return ((Component) => <Component source={{uri: a0.url}} onLoad={onLoad_87989} onError={onError_87992} key={a1} />)(Module08011);
|
|
function onLoad_87989(a0) { // fn#87989, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2762, offset: 0x01fd0a0d, size: 48 bytes, params: 2, frame: 13
|
|
const env0_0 = a0;
|
|
env1_4(_fun87990);
|
|
env1_8(function(a0) {
|
|
return a0 - 1;
|
|
});
|
|
function _fun87990(a0) { // fn#87990, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2769, offset: 0x01fd0a3d, size: 70 bytes, params: 2, frame: 14
|
|
const object = {};
|
|
copyDataProperties(object, a0, undefined);
|
|
const id = env1_0.id;
|
|
const binding = env0_0;
|
|
object[id] = {width: binding.naturalSize.width, height: binding.naturalSize.height};
|
|
return object;
|
|
}
|
|
|
|
}
|
|
|
|
function onError_87992() { // fn#87992, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2867, offset: 0x01fd0a83, size: 25 bytes, params: 1, frame: 11
|
|
return env1_8(function(a0) {
|
|
return a0 - 1;
|
|
});
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun87966, 11483, [57, 31, 27, 1310, 1878, 11473, 5267, 661, 33, 8177, 4501, 566, 4002, 11484, 11485,
|
|
5266, 4631, 9544, 8011, 9869, 9773, 4625, 21,
|
|
2]) /* metro module 11483, dependencies: [57, 31, 27, 1310, 1878, 11473, 5267, 661, 33, 8177, 4501, 566, 4002, 11484, 11485, 5266, 4631, 9544, 8011, 9869, 9773, 4625, 21, 2] */;
|