Files
2026-07-28 01:06:53 +03:00

250 lines
11 KiB
TypeScript

/* Metro module 12678; source: modules/share/native/ShareEmbed.tsx; dependencies: [31, 27, 33, 4501, 697, 5461, 4573, 2] */
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 TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
function _fun97145(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#97145, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12868:6, offset: 0x02174796, size: 435 bytes, params: 8, frame: 25
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactNativeModule;
const env0_3 = value.Image;
const env0_4 = value.View;
value = require(33) /* metro dependency 33 */;
const env0_5 = value.jsx;
const env0_6 = value.jsxs;
const env0_7 = value.Fragment;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object = {};
const object2 = {'flexDirection': 'row', 'height': 80, 'backgroundColor': null, 'borderColor': null,
'borderWidth': 1, 'borderRadius': null, 'overflow': 'hidden'};
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object2.backgroundColor = BACKGROUND_BASE_LOW;
const BORDER_STRONG = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_STRONG;
object2.borderColor = BORDER_STRONG;
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object.container = object2;
object.containerRevamp = {borderWidth: 0};
object.thumbnail = {width: 80};
object.contentContainer = {'flex': 1, 'flexDirection': 'column', 'justifyContent': 'center', 'paddingLeft': 12,
'paddingRight': 24};
object.authorView = {'flexDirection': 'row', 'alignItems': 'center', 'marginBottom': 3};
const object5 = {'height': 16, 'width': 16, 'borderRadius': null, 'marginRight': 4};
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object.authorThumbnail = object5;
object.loadingSpinner = {flex: 1};
const env0_8 = Reflect.apply(createStyles, value, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/share/native/ShareEmbed.tsx');
exports.default = ShareEmbed;
function ShareEmbed({embed, isLoadingEmbed, isRevamp}) { // fn#97146, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12868:806, offset: 0x02174949, size: 425 bytes, params: 2, frame: 30
var r5;
var r0;
var jsxRuntimeEnv0_7Binding;
var items2;
const styles = useStyles();
const binding = styles;
const useMemo = binding.useMemo;
const items = [embed];
const value3 = Reflect.apply(useMemo, binding, [function() {
var r1;
if (embed != null) {
var property = embed.thumbnail;
var value2 = undefined;
r1 = property == null ? value2 : property.url;
r1 = r1 ?? (embed.image == null ? value2 : embed.image.url);
if (r1 != null) {
return {uri: r1};
}
}
}, items]);
const value4 = binding.useMemo(_fun97148, [isLoadingEmbed, styles]);
const value5 = binding.useMemo(_fun97149, [embed, styles]);
const value6 = binding.useMemo(_fun97150, [embed]);
const value7 = binding.useMemo(_fun97151, [embed, value6]);
const value8 = binding.useMemo(_fun97152, [embed]);
if (embed != null) {
var viewProps = {style: [styles.container, isRevamp ? styles.containerRevamp : undefined]};
if (isLoadingEmbed) {
r5 = value4;
} else {
jsxRuntimeEnv0_7Binding = jsxRuntimeEnv0_7;
items2 = [
value3 != null && <Image style={styles.thumbnail} source={value3} resizeMode="cover" />,
];
items2[1] = (
<View style={styles.contentContainer}>
{value5}
{value6}
{value7}
{value8}
</View>
);
r5 = (
<>
{items2}
</>
);
}
r0 = (
<View {...viewProps}>
{r5}
</View>
);
} else if (isLoadingEmbed) {
var viewProps = {style: [styles.container, isRevamp ? styles.containerRevamp : undefined]};
if (isLoadingEmbed) {
r5 = value4;
} else {
jsxRuntimeEnv0_7Binding = jsxRuntimeEnv0_7;
items2 = [
value3 != null && <Image style={styles.thumbnail} source={value3} resizeMode="cover" />,
];
items2[1] = (
<View style={styles.contentContainer}>
{value5}
{value6}
{value7}
{value8}
</View>
);
r5 = (
<>
{items2}
</>
);
}
r0 = (
<View {...viewProps}>
{r5}
</View>
);
} else {
r0 = null;
}
return r0;
function _fun97148() { // fn#97148, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12868:1045, offset: 0x02174b46, size: 71 bytes, params: 1, frame: 15
if (isLoadingEmbed) {
const ActivityIndicator = (require(5461) /* metro dependency 5461: ActivityIndicatorNative */).ActivityIndicator;
return <ActivityIndicator style={styles.loadingSpinner} />;
} else {
return null;
}
}
function _fun97149() { // fn#97149, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12868:1131, offset: 0x02174b8d, size: 219 bytes, params: 1, frame: 22
const author = embed?.author;
if (author == null) {
return null;
}
const r12 = author.proxy_icon_url ?? author.icon_url;
const r7 = r12 != null && <Image style={styles.authorThumbnail} source={{uri: r12}} resizeMode="cover" />;
const Text = (TextModule).Text;
return (
<View style={styles.authorView}>
{r7}
<Text
variant="text-xs/semibold"
color="mobile-text-heading-primary"
ellipsizeMode="tail"
lineClamp={1}
>
{author.name}
</Text>
</View>
);
}
function _fun97150() { // fn#97150, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12868:1507, offset: 0x02174c68, size: 112 bytes, params: 1, frame: 17
var r0;
var value;
const embedBinding = embed;
const value2 = null;
const title = value2 == embedBinding ? undefined : embed.title;
if (value2 != title) {
value = environment.__proto__;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
value = (
<Text
style={{marginVertical: 1}}
variant="text-xs/semibold"
color="mobile-text-heading-primary"
lineClamp={1}
ellipsizeMode="tail"
>
{title}
</Text>
);
r0 = value;
} else {
r0 = value2;
}
return r0;
}
function _fun97151() { // fn#97151, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12868:1731, offset: 0x02174cd8, size: 125 bytes, params: 1, frame: 17
var r0;
var value;
const embedBinding = embed;
const value2 = null;
const description = value2 == embedBinding ? undefined : embed.description;
if (value2 == env0_3) {
if (value2 != description) {
value = environment.__proto__;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
value = (
<Text
style={{marginVertical: 1}}
variant="text-xs/medium"
color="text-default"
lineClamp={1}
ellipsizeMode="tail"
>
{description}
</Text>
);
r0 = value;
} else {
r0 = value2;
}
} else {
r0 = value2;
}
return r0;
}
function _fun97152() { // fn#97152, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12868:1955, offset: 0x02174d55, size: 112 bytes, params: 1, frame: 17
var r0;
var value;
const embedBinding = embed;
const value2 = null;
const url = value2 == embedBinding ? undefined : embed.url;
if (value2 != url) {
value = environment.__proto__;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
value = (
<Text
style={{marginVertical: 1}}
variant="text-xs/medium"
color="text-link"
lineClamp={1}
ellipsizeMode="tail"
>
{url}
</Text>
);
r0 = value;
} else {
r0 = value2;
}
return r0;
}
}
}
global.__d(_fun97145, 12678, [31, 27, 33, 4501, 697, 5461, 4573,
2]) /* metro module 12678, dependencies: [31, 27, 33, 4501, 697, 5461, 4573, 2] */;