This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,252 @@
// Metro module 11423 (f11424).
import _slicedToArray from "../../../_bundle/_slicedToArray";
import { useEffect, useState, useCallback } from "react";
import { View } from "react-native";
import StickersStore from "../../stickers/StickersStore";
import MessageStore from "../../../stores/MessageStore";
import UserStore from "../../../stores/UserStore";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import { GradientPercentage, useGradientValue } from "../../client_themes/native/ClientThemesUtils";
import { useToken } from "../../../design/tokens/native/useToken";
import { hexWithOpacity } from "../../../utils/ColorUtils";
import ToastActionCreators from "../../toast/native/ToastActionCreators";
import Module11424 from "../../../_bundle/Module11424";
import { trackWaveCtaClicked } from "../../channel/trackWaveCtaClicked";
import MessageActionCreators from "../../../actions/MessageActionCreators";
import { intl, t } from "../../../intl/index.native";
import { useStateFromStores } from "../../../_bundle/Module589";
import { MessageTypes } from "../../../_bundle/Module686";
import UserUtils from "../../../utils/UserUtils";
import { useShowConvoStarterInDM } from "../useShowConvoStarterInDM";
import { fetchStickerPack } from "../../stickers/StickersActionCreators";
import * as _ReanimatedRexport from "../../reanimated/ReanimatedRexport";
import ReanimatedRexport, { useAnimatedStyle } from "../../reanimated/ReanimatedRexport";
import * as _timing from "../../../design/animation/reanimated/timing/timing";
import * as _native from "../../../design/void/native";
import { useShouldAnimateSticker } from "../../stickers/StickersHooks";
import Module4611 from "../../../_bundle/Module4611";
import { PressableOpacity } from "../../../design/void/Pressables/native/Pressables";
import Sticker from "../../stickers/native/Sticker";
import { Text } from "../../../design/components/Text/native/Text";
import { Button } from "../../../design/components/Button/native/Button.native";
let c7772_14, END, c7772_16;
let env7772 = {};
const useStyles = createStyles((a0) => ({
container: {
backgroundColor: a0 == null ? Module712.colors.BACKGROUND_BASE_LOWER : a0,
alignItems: "center",
paddingHorizontal: 16,
paddingBottom: 16,
paddingTop: 8
},
stickerContainer: {
paddingBottom: 16
},
toastContainer: {
flexDirection: "row",
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST,
justifyContent: "center",
alignItems: "center",
gap: 8,
height: 48,
paddingHorizontal: 16,
borderRadius: Module712.radii.xxl
},
toastContent: {
lineHeight: 20
},
gradient: {
position: "absolute",
right: 0,
left: 0,
top: 0,
height: 30
}
}));
c7772_14 = "749054660769218631";
END = GradientPercentage.END;
c7772_16 = {
code: "function DMMessageStickerGreetingTsx1(){const{styles,isRendered,hasInputText,hasMessages,HEIGHT_COMPACT,HEIGHT_FULL,withDelay,withTiming,STANDARD_EASING}=this.__closure;const gradientOverlayOffset=styles.gradient.height;const hasHeight=isRendered&&!hasInputText;const heightExpanded=(hasMessages?HEIGHT_COMPACT:HEIGHT_FULL)-1;const targetHeight=hasHeight?heightExpanded+gradientOverlayOffset:0;const targetMargin=hasHeight?-gradientOverlayOffset:0;function generateAnimationConfig(value){return withDelay(300,withTiming(value,{easing:STANDARD_EASING,duration:250}));}return{justifyContent:'flex-end',overflow:'hidden',marginTop:generateAnimationConfig(targetMargin),height:generateAnimationConfig(targetHeight)};}"
};
export default function DMMessageStickerGreeting(props) {
let showConvoStarterInDM, state;
const { channel, hasInputText } = props;
showConvoStarterInDM = void 0;
state = void 0;
const styles = useStyles(useGradientValue(END));
let c18822_2 = styles;
const stateFromStores = useStateFromStores([MessageStore], () => MessageStore.getMessages(channel.id).filter((item) => item.type !== MessageTypes.FRIEND_REQUEST_ACCEPTED).length > 0);
let username = UserUtils.useName(useStateFromStores([UserStore], () => UserStore.getUser(channel.getRecipientId())));
if (username == null) {
username = intl.string(t.y1Wu2f);
}
let env18823;
let setState;
const text = intl.formatToPlainString(t.m0zYbV, {
username
});
showConvoStarterInDM = useShowConvoStarterInDM(channel);
const stateFromStores2 = useStateFromStores([StickersStore], () => showConvoStarterInDM ? StickersStore.getStickerById(c7772_14) : null, [showConvoStarterInDM]);
useEffect(() => {
if (showConvoStarterInDM) {
fetchStickerPack("847199849233514549", true);
}
}, [showConvoStarterInDM]);
env18823 = {
$parent: env7772
};
env18823[0] = channel;
env18823[1] = void 0;
env18823[2] = void 0;
env18823[3] = void 0;
env18823[4] = void 0;
const r80 = _slicedToArray(useState(null), 2);
const r20 = r80[0];
env18823[1] = r20;
env18823[2] = r80[1];
const r84 = _slicedToArray(useState(false), 2);
const r22 = r84[0];
env18823[3] = r22;
env18823[4] = r84[1];
useEffect(() => {
(0, env18823[2])(null);
}, [channel.id]);
const callback = useCallback(async () => {
let c30405_0, c30405_1, c30405_2;
let c30405_3 = 0;
const r10 = env18823;
L17: {
L15: {
try {
let env31626;
c30405_1 = r10;
const r33 = env31626 = {
$parent: r10
};
c30405_0 = r33;
const showErrorToast = function showErrorToast(a0) {
if (env18823[1] !== a0) {
(0, env18823[2])(a0);
}
ToastActionCreators.open({
key: "HANDLE_WAVE_PRESS_TOAST",
content: a0,
icon: Module11424
});
};
env31626[0] = showErrorToast;
if (env18823[3]) {
break L17;
}
(0, env18823[4])(true);
const r38 = env18823[1];
if (r38 === null) {
c30405_3 = 1;
const r44 = env18823[0];
trackWaveCtaClicked({
channelId: r44.id,
source: "In-channel greet"
});
await MessageActionCreators.sendGreetMessage(r44.id, c7772_14);
c30405_3 = 0;
(0, env18823[4])(false);
break L15;
}
(0, env18823[4])(false);
showErrorToast(r38);
} catch ($e) {
const r31 = $e;
let r7 = r31;
c30405_2 = r31;
if (c30405_3 !== 0) {
while (true) {
try {
const r84 = c30405_2;
c30405_3 = 0;
env31626[1] = r84;
if (!(env31626[1].ok || env31626[1].status !== 429)) {
env31626[0](intl.string(t.Whhv4w));
}
(0, env18823[4])(false);
break L15;
} catch (r81) {
r7 = r81;
c30405_2 = r81;
if (c30405_3 === 0) {
break;
}
}
}
}
throw r7;
}
return void 0;
}
return void 0;
}
}, [r22, r20, channel.id]);
setState = void 0;
let state2;
[state2, setState] = useState(false);
const callback2 = useCallback(() => {
setState(true);
}, [setState]);
state = state2;
const w = function w() {
const height = c18822_2.gradient.height;
let r4 = state;
if (state) {
r4 = !hasInputText;
}
const r9 = r4 ? (stateFromStores ? 72 : 180) - 1 + height : 0;
return {
justifyContent: "flex-end",
overflow: "hidden",
marginTop: _ReanimatedRexport.withDelay(300, _timing.withTiming(r4 ? -height : 0, {
easing: _native.STANDARD_EASING,
duration: 250
})),
height: _ReanimatedRexport.withDelay(300, _timing.withTiming(r9, {
easing: _native.STANDARD_EASING,
duration: 250
}))
};
};
w.__closure = {
styles,
isRendered: state,
hasInputText,
hasMessages: stateFromStores,
HEIGHT_COMPACT: 72,
HEIGHT_FULL: 180,
withDelay: _ReanimatedRexport.withDelay,
withTiming: _timing.withTiming,
STANDARD_EASING: _native.STANDARD_EASING
};
w.__workletHash = 6327401707106;
w.__initData = c7772_16;
const animatedStyle = useAnimatedStyle(w);
let r127 = useGradientValue(END);
if (r127 == null) {
r127 = Module712.colors.BACKGROUND_BASE_LOWER;
}
const token = useToken(r127);
const colors = [hexWithOpacity(token, 0), token];
const shouldAnimateSticker = useShouldAnimateSticker(false);
const r145 = showConvoStarterInDM ? <ReanimatedRexport.View style={animatedStyle} onLayout={callback2}>
<Module4611 style={styles.gradient} colors={colors} />
<View style={styles.container}>
{stateFromStores ? <PressableOpacity style={styles.toastContainer} accessibilityRole="button" accessibilityLabel={intl.string(t.pJObYI)} onPress={callback}>
{stateFromStores2 != null ? <Sticker sticker={stateFromStores2} size={24} animated={shouldAnimateSticker} /> : null}
<Text style={styles.toastContent} variant="text-md/bold">{text}</Text>
</PressableOpacity> : <>
{stateFromStores2 != null ? <View style={styles.stickerContainer}>
<Sticker sticker={stateFromStores2} size={100} animated={shouldAnimateSticker} />
</View> : null}
<Button text={text} onPress={callback} shrink />
</>}
</View>
</ReanimatedRexport.View> : null;
return r145;
};