/* Metro module 11784; source: modules/messages/native/DMMessageStickerGreeting.tsx; dependencies: [5, 57, 31, 27, 6583, 4814, 1878, 33, 4501, 697, 3963, 3860, 4000, 3857, 11785, 11786, 7067, 1244, 566, 671, 3995, 11787, 11050, 4017, 4504, 1305, 11049, 4589, 5278, 10970, 4573, 4578, 2] */
function _fun90262(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90262, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11970:6, offset: 0x020320b3, size: 339 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
const env0_4 = importDefault(57) /* metro dependency 57 */;
const env0_5 = importAll(31) /* metro dependency 31 */;
const env0_6 = (require(27) /* metro dependency 27 */).View;
const stickersStore = importDefault(6583) /* metro dependency 6583: StickersStore */;
const messageStore = importDefault(4814) /* metro dependency 4814: MessageStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const value = require(33) /* metro dependency 33 */;
const env0_10 = value.jsx;
const env0_11 = value.jsxs;
const env0_12 = value.Fragment;
const env0_13 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(_fun90263);
const GradientPercentage = (require(3963) /* metro dependency 3963: ClientThemesUtils */).GradientPercentage;
const env0_14 = GradientPercentage.END;
object = {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;const generateAnimationConfig=function(value){return withDelay(300,withTiming(value,{easing:STANDARD_EASING,duration:250}));};return{justifyContent:'flex-end',overflow:'hidden',marginTop:generateAnimationConfig(targetMargin),height:generateAnimationConfig(targetHeight)};}"};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/messages/native/DMMessageStickerGreeting.tsx');
exports.default = DMMessageStickerGreeting;
}
function _fun90263(a0) { // fn#90263, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11970:235, offset: 0x02032206, size: 207 bytes, params: 2, frame: 15
const value = a0;
const object2 = {};
object2.container = {'backgroundColor': null, 'alignItems': 'center', 'paddingHorizontal': 16, 'paddingBottom': 16,
'paddingTop': 8,
backgroundColor: value ?? (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWER};
object2.stickerContainer = {paddingBottom: 16};
const object3 = {'flexDirection': 'row', 'backgroundColor': null, 'justifyContent': 'center',
'alignItems': 'center', 'gap': 8, 'height': 48, 'paddingHorizontal': 16};
const BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST;
object3.backgroundColor = BACKGROUND_BASE_LOWEST;
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xxl;
object2.toastContainer = object3;
object2.toastContent = {lineHeight: 20};
object2.gradient = {'position': 'absolute', 'right': 0, 'left': 0, 'top': 0, 'height': 30};
return object2;
}
function DMMessageStickerGreeting({channel, hasInputText}) { // fn#90264, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11970:1610, offset: 0x020322d5, size: 1339 bytes, params: 2, frame: 38
var r0;
var r9;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var View2;
var object3;
var PressableOpacity;
var items3;
const clientThemesUtilsModule = require(3963) /* metro dependency 3963: ClientThemesUtils */;
const useGradientValue = clientThemesUtilsModule.useGradientValue;
const styles = useStyles(Reflect.apply(useGradientValue, clientThemesUtilsModule, [END]));
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([MessageStore], _fun90265);
const user = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return UserStore.getUser(channel.getRecipientId());
});
const value7 = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.m0zYbV,
{username: (importDefault(3995) /* metro dependency 3995: UserUtils */).useName(user) ?? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.y1Wu2f)});
const value8 = (require(11787) /* metro dependency 11787: useShowConvoStarterInDM */).useShowConvoStarterInDM(channel);
const value9 = (require(566) /* metro dependency 566: flux */).useStateFromStores([StickersStore], _fun90268,
[value8]);
undefined.useEffect(_fun90269, [value8]);
const value10 = useHandleWavePress(channel);
const {isRendered, setIsRendered} = useIsRendered();
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = DMMessageStickerGreetingX;
object = {styles: styles, isRendered: isRendered, hasInputText: hasInputText, hasMessages: value3,
HEIGHT_COMPACT: 72, HEIGHT_FULL: 180};
object.withDelay = reanimatedRexportModule.withDelay;
object.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
const STANDARD_EASING = (require(1305) /* metro dependency 1305: native */).STANDARD_EASING;
object.STANDARD_EASING = STANDARD_EASING;
closure.__closure = object;
closure.__workletHash = 14002474476449;
closure.__initData = env0_15;
const value12 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const value14 = (require(3860) /* metro dependency 3860: useToken */).useToken(clientThemesUtilsModule.useGradientValue(END) ?? (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWER);
object = [(require(4000) /* metro dependency 4000: ColorUtils */).hexWithOpacity(value14, 0), value14];
const value16 = (require(11049) /* metro dependency 11049: StickersHooks */).useShouldAnimateSticker(false);
if (value8) {
View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
object3 = {style: value12, onLayout: setIsRendered};
object = [((Component) => )(importDefault(4589) /* metro dependency 4589 */)];
var viewBindingProps = {style: styles.container};
if (value3) {
PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
var pressableOpacityProps2 = {style: styles.toastContainer, accessibilityRole: 'button',
accessibilityLabel: intl.string((require(1244) /* metro dependency 1244: indexNative */).t.pJObYI),
onPress: value10};
items3 = [value9 != null ? ((Component) => )(importDefault(10970) /* metro dependency 10970: Sticker */) : null];
items3[1] = ((Text) => {value7})((require(4573) /* metro dependency 4573: Text */).Text);
r9 = {items3};
} else {
r9 = <>{value9 != null ? {((Component) => )(importDefault(10970) /* metro dependency 10970: Sticker */)} : null}{((Button) => )((require(4578) /* metro dependency 4578: ButtonNative */).Button)}>;
}
object[1] = {r9};
r0 = {object};
} else {
r0 = null;
}
return r0;
}
function _fun90265() { // fn#90265, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11970:1751, offset: 0x02032810, size: 62 bytes, params: 1, frame: 11
var environment;
let value = environment.__proto__;
value = MessageStore.getMessages(channel.id);
return value.filter(function({type}) {
return type !== require(dependencyMap[19]).MessageTypes.FRIEND_REQUEST_ACCEPTED;
}).length > 0;
}
function _fun90268() { // fn#90268, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11970:2140, offset: 0x020328a6, size: 38 bytes, params: 1, frame: 12
var r0;
let value = null;
if (env0_4) {
value = environment.__proto__;
value = StickersStore.getStickerById('749054660769218631');
r0 = value;
} else {
r0 = value;
}
return r0;
}
function _fun90269() { // fn#90269, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11970:2190, offset: 0x020328cc, size: 59 bytes, params: 1, frame: 13
var value;
if (env0_4) {
value = environment.__proto__;
value = require(11050) /* metro dependency 11050: StickersActionCreators */;
value.fetchStickerPack('847199849233514549', true);
}
}
function useHandleWavePress(a0) { // fn#90270, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11970:2264, owner: DMMessageStickerGreeting.useHandleWavePress, offset: 0x02032907, size: 179 bytes, params: 2, frame: 21
var environment;
const env0_0 = a0;
const value = environment.__proto__;
const binding = env1_5;
let useState = binding.useState;
const value2 = Reflect.apply(useState, binding, [null]);
const binding2 = env1_4;
const value3 = binding2(value2, 2);
const property = value3[0];
const env0_2 = value3[1];
useState = binding.useState;
const value4 = binding2(Reflect.apply(useState, binding, [false]), 2);
const property2 = value4[0];
const env0_4 = value4[1];
binding.useEffect(_fun90271, [a0.id]);
return binding.useCallback(env1_3(_fun90273), [property2, property, a0.id]);
}
function useIsRendered() { // fn#90275, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11970:2848, owner: DMMessageStickerGreeting.useIsRendered, offset: 0x02032b60, size: 93 bytes, params: 1, frame: 15
var environment;
let value = environment.__proto__;
const binding = env1_5;
value = env1_4(binding.useState(false), 2);
const property = value[0];
const property2 = value[1];
const useCallback = binding.useCallback;
return {isRendered: property, setIsRendered: Reflect.apply(useCallback, binding, [_fun90276, [property2]])};
}
function DMMessageStickerGreetingX() { // fn#90277, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11970:3053, owner: DMMessageStickerGreeting.x, offset: 0x02032bbd, size: 114 bytes, params: 1, frame: 14
var r3;
var value;
const height = styles.gradient.height;
const r5 = isRendered && !hasInputText;
const value3 = 0;
if (r5) {
value = 180;
value = (env0_3 ? 72 : value) - 1 + height;
r3 = value;
} else {
r3 = value3;
}
const closure = generateAnimationConfig;
const object2 = {'justifyContent': 'flex-end', 'overflow': 'hidden'};
object2.marginTop = closure(r5 ? -height : value3);
object2.height = closure(r3);
return object2;
}
function* _fun90273() { // fn#90273, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11970:2441, offset: 0x020329c5, size: 316 bytes, params: 1, frame: 21
var environment;
var r4;
var binding;
var binding2;
var property;
var value4;
var trackWaveCtaClicked;
var object2;
var channelBinding;
var id;
var value5;
var sendGreetMessage;
var value6;
var value7;
var value8;
var error;
var ok;
var status;
var value9;
var binding3;
var intl;
var string;
var t;
var Whhv4w;
if (true) {
value = environment.__proto__;
if (!env1_3) {
env1_4(true);
var closure = showErrorToast;
if (hasInputText !== null) {
env1_4(false);
return closure(hasInputText);
}
try {
binding = env3_0;
} catch (error) {
ok = error.ok;
if (ok) {
r4 = ok;
} else {
status = error.status;
value9 = status !== 429;
r4 = value9;
}
if (!r4) {
binding = env3_0;
binding3 = env3_2;
intl = binding(binding3[17]).intl;
string = intl.string;
t = binding(binding3[17]).t;
Whhv4w = t.Whhv4w;
closure(Reflect.apply(string, intl, [Whhv4w]));
}
env1_4(false);
return undefined;
}
try {
binding2 = env3_2;
} catch (error) {
ok = error.ok;
if (ok) {
r4 = ok;
} else {
status = error.status;
value9 = status !== 429;
r4 = value9;
}
if (!r4) {
binding = env3_0;
binding3 = env3_2;
intl = binding(binding3[17]).intl;
string = intl.string;
t = binding(binding3[17]).t;
Whhv4w = t.Whhv4w;
closure(Reflect.apply(string, intl, [Whhv4w]));
}
env1_4(false);
return undefined;
}
try {
property = binding2[15];
} catch (error) {
ok = error.ok;
if (ok) {
r4 = ok;
} else {
status = error.status;
value9 = status !== 429;
r4 = value9;
}
if (!r4) {
binding = env3_0;
binding3 = env3_2;
intl = binding(binding3[17]).intl;
string = intl.string;
t = binding(binding3[17]).t;
Whhv4w = t.Whhv4w;
closure(Reflect.apply(string, intl, [Whhv4w]));
}
env1_4(false);
return undefined;
}
try {
value4 = binding(property);
} catch (error) {
ok = error.ok;
if (ok) {
r4 = ok;
} else {
status = error.status;
value9 = status !== 429;
r4 = value9;
}
if (!r4) {
binding = env3_0;
binding3 = env3_2;
intl = binding(binding3[17]).intl;
string = intl.string;
t = binding(binding3[17]).t;
Whhv4w = t.Whhv4w;
closure(Reflect.apply(string, intl, [Whhv4w]));
}
env1_4(false);
return undefined;
}
try {
trackWaveCtaClicked = value4.trackWaveCtaClicked;
} catch (error) {
ok = error.ok;
if (ok) {
r4 = ok;
} else {
status = error.status;
value9 = status !== 429;
r4 = value9;
}
if (!r4) {
binding = env3_0;
binding3 = env3_2;
intl = binding(binding3[17]).intl;
string = intl.string;
t = binding(binding3[17]).t;
Whhv4w = t.Whhv4w;
closure(Reflect.apply(string, intl, [Whhv4w]));
}
env1_4(false);
return undefined;
}
try {
object2 = {};
} catch (error) {
ok = error.ok;
if (ok) {
r4 = ok;
} else {
status = error.status;
value9 = status !== 429;
r4 = value9;
}
if (!r4) {
binding = env3_0;
binding3 = env3_2;
intl = binding(binding3[17]).intl;
string = intl.string;
t = binding(binding3[17]).t;
Whhv4w = t.Whhv4w;
closure(Reflect.apply(string, intl, [Whhv4w]));
}
env1_4(false);
return undefined;
}
try {
channelBinding = channel;
} catch (error) {
ok = error.ok;
if (ok) {
r4 = ok;
} else {
status = error.status;
value9 = status !== 429;
r4 = value9;
}
if (!r4) {
binding = env3_0;
binding3 = env3_2;
intl = binding(binding3[17]).intl;
string = intl.string;
t = binding(binding3[17]).t;
Whhv4w = t.Whhv4w;
closure(Reflect.apply(string, intl, [Whhv4w]));
}
env1_4(false);
return undefined;
}
try {
id = channelBinding.id;
} catch (error) {
ok = error.ok;
if (ok) {
r4 = ok;
} else {
status = error.status;
value9 = status !== 429;
r4 = value9;
}
if (!r4) {
binding = env3_0;
binding3 = env3_2;
intl = binding(binding3[17]).intl;
string = intl.string;
t = binding(binding3[17]).t;
Whhv4w = t.Whhv4w;
closure(Reflect.apply(string, intl, [Whhv4w]));
}
env1_4(false);
return undefined;
}
try {
object2.channelId = id;
} catch (error) {
ok = error.ok;
if (ok) {
r4 = ok;
} else {
status = error.status;
value9 = status !== 429;
r4 = value9;
}
if (!r4) {
binding = env3_0;
binding3 = env3_2;
intl = binding(binding3[17]).intl;
string = intl.string;
t = binding(binding3[17]).t;
Whhv4w = t.Whhv4w;
closure(Reflect.apply(string, intl, [Whhv4w]));
}
env1_4(false);
return undefined;
}
try {
object2.source = 'In-channel greet';
} catch (error) {
ok = error.ok;
if (ok) {
r4 = ok;
} else {
status = error.status;
value9 = status !== 429;
r4 = value9;
}
if (!r4) {
binding = env3_0;
binding3 = env3_2;
intl = binding(binding3[17]).intl;
string = intl.string;
t = binding(binding3[17]).t;
Whhv4w = t.Whhv4w;
closure(Reflect.apply(string, intl, [Whhv4w]));
}
env1_4(false);
return undefined;
}
try {
Reflect.apply(trackWaveCtaClicked, value4, [object2]);
} catch (error) {
ok = error.ok;
if (ok) {
r4 = ok;
} else {
status = error.status;
value9 = status !== 429;
r4 = value9;
}
if (!r4) {
binding = env3_0;
binding3 = env3_2;
intl = binding(binding3[17]).intl;
string = intl.string;
t = binding(binding3[17]).t;
Whhv4w = t.Whhv4w;
closure(Reflect.apply(string, intl, [Whhv4w]));
}
env1_4(false);
return undefined;
}
try {
binding = env3_1;
} catch (error) {
ok = error.ok;
if (ok) {
r4 = ok;
} else {
status = error.status;
value9 = status !== 429;
r4 = value9;
}
if (!r4) {
binding = env3_0;
binding3 = env3_2;
intl = binding(binding3[17]).intl;
string = intl.string;
t = binding(binding3[17]).t;
Whhv4w = t.Whhv4w;
closure(Reflect.apply(string, intl, [Whhv4w]));
}
env1_4(false);
return undefined;
}
try {
property = binding2[16];
} catch (error) {
ok = error.ok;
if (ok) {
r4 = ok;
} else {
status = error.status;
value9 = status !== 429;
r4 = value9;
}
if (!r4) {
binding = env3_0;
binding3 = env3_2;
intl = binding(binding3[17]).intl;
string = intl.string;
t = binding(binding3[17]).t;
Whhv4w = t.Whhv4w;
closure(Reflect.apply(string, intl, [Whhv4w]));
}
env1_4(false);
return undefined;
}
try {
value5 = binding(property);
} catch (error) {
ok = error.ok;
if (ok) {
r4 = ok;
} else {
status = error.status;
value9 = status !== 429;
r4 = value9;
}
if (!r4) {
binding = env3_0;
binding3 = env3_2;
intl = binding(binding3[17]).intl;
string = intl.string;
t = binding(binding3[17]).t;
Whhv4w = t.Whhv4w;
closure(Reflect.apply(string, intl, [Whhv4w]));
}
env1_4(false);
return undefined;
}
try {
sendGreetMessage = value5.sendGreetMessage;
} catch (error) {
ok = error.ok;
if (ok) {
r4 = ok;
} else {
status = error.status;
value9 = status !== 429;
r4 = value9;
}
if (!r4) {
binding = env3_0;
binding3 = env3_2;
intl = binding(binding3[17]).intl;
string = intl.string;
t = binding(binding3[17]).t;
Whhv4w = t.Whhv4w;
closure(Reflect.apply(string, intl, [Whhv4w]));
}
env1_4(false);
return undefined;
}
try {
id = channelBinding.id;
} catch (error) {
ok = error.ok;
if (ok) {
r4 = ok;
} else {
status = error.status;
value9 = status !== 429;
r4 = value9;
}
if (!r4) {
binding = env3_0;
binding3 = env3_2;
intl = binding(binding3[17]).intl;
string = intl.string;
t = binding(binding3[17]).t;
Whhv4w = t.Whhv4w;
closure(Reflect.apply(string, intl, [Whhv4w]));
}
env1_4(false);
return undefined;
}
try {
value6 = Reflect.apply(sendGreetMessage, value5, [id, '749054660769218631']);
} catch (error) {
ok = error.ok;
if (ok) {
r4 = ok;
} else {
status = error.status;
value9 = status !== 429;
r4 = value9;
}
if (!r4) {
binding = env3_0;
binding3 = env3_2;
intl = binding(binding3[17]).intl;
string = intl.string;
t = binding(binding3[17]).t;
Whhv4w = t.Whhv4w;
closure(Reflect.apply(string, intl, [Whhv4w]));
}
env1_4(false);
return undefined;
}
yield value6;
try {
value7 = undefined;
value8 = false;
} catch (error) {
ok = error.ok;
if (ok) {
r4 = ok;
} else {
status = error.status;
value9 = status !== 429;
r4 = value9;
}
if (!r4) {
binding = env3_0;
binding3 = env3_2;
intl = binding(binding3[17]).intl;
string = intl.string;
t = binding(binding3[17]).t;
Whhv4w = t.Whhv4w;
closure(Reflect.apply(string, intl, [Whhv4w]));
}
env1_4(false);
return undefined;
}
if (value8) {
return value7;
}
env1_4(false);
}
}
}
function generateAnimationConfig(a0) { // fn#90278, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11970:3141, owner: DMMessageStickerGreeting.x.generateAnimationConfig, offset: 0x02032c2f, size: 103 bytes, params: 2, frame: 18
let value = environment.__proto__.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const withDelay = value.withDelay;
const timingModule = require(4504) /* metro dependency 4504: timing */;
const withTiming = timingModule.withTiming;
const STANDARD_EASING = (require(1305) /* metro dependency 1305: native */).STANDARD_EASING;
return Reflect.apply(withDelay, value, [300, Reflect.apply(withTiming, timingModule, [a0, {easing: STANDARD_EASING,
duration: 250}])]);
}
function showErrorToast(a0) { // fn#90274, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11970:2485, offset: 0x02032b01, size: 95 bytes, params: 2, frame: 16
let value = environment.__proto__.__proto__;
if (hasInputText !== a0) {
styles(a0);
}
value = environment.__proto__.__proto__.__proto__.__proto__;
const binding = env4_1;
const binding2 = env4_2;
value = binding(binding2[13]);
value.open({key: 'HANDLE_WAVE_PRESS_TOAST', content: a0, icon: binding(binding2[14])});
}