2026-09-16 07:03:15 +00:00
|
|
|
// Module ID: 8117
|
|
|
|
|
// Function ID: 8118
|
2026-09-10 05:38:07 +00:00
|
|
|
// Name: WelcomeCTAUtils
|
2026-09-16 07:03:15 +00:00
|
|
|
// Dependencies: [1372, 8118, 1074, 11, 7566, 1241, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: handleWelcomeCtaClicked, pickHelloSticker, pickWelcomeSticker
|
|
|
|
|
|
2026-09-16 07:03:15 +00:00
|
|
|
// Module 8117 (WelcomeCTAUtils)
|
2026-09-10 05:38:07 +00:00
|
|
|
import SnowflakeUtilsDefault from "SnowflakeUtils" /* 11 */;
|
2026-09-15 14:23:42 +00:00
|
|
|
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1241 */;
|
2026-09-16 07:03:15 +00:00
|
|
|
import MessageActionCreatorsDefault from "MessageActionCreators" /* 7566 */;
|
2026-09-15 14:23:42 +00:00
|
|
|
import UserStore from "UserStore" /* 1372 */;
|
2026-07-23 10:11:24 +00:00
|
|
|
|
2026-09-16 07:03:15 +00:00
|
|
|
const WELCOME_STICKERS = fn(8118).WELCOME_STICKERS;
|
2026-09-10 05:38:07 +00:00
|
|
|
const AnalyticEvents = fn(1074).AnalyticEvents;
|
|
|
|
|
const size = fn(2);
|
|
|
|
|
const result = size.fileFinishedImporting("modules/welcome_cta/WelcomeCTAUtils.tsx");
|
2026-07-20 16:05:17 +00:00
|
|
|
|
|
|
|
|
export const pickHelloSticker = function pickHelloSticker() {
|
2026-09-10 05:38:07 +00:00
|
|
|
const currentUser = UserStore.getCurrentUser();
|
2026-07-20 16:05:17 +00:00
|
|
|
let id;
|
2026-07-29 08:29:29 +00:00
|
|
|
if (currentUser != null) {
|
2026-07-20 16:05:17 +00:00
|
|
|
id = currentUser.id;
|
|
|
|
|
}
|
|
|
|
|
let num = 0;
|
|
|
|
|
if (null != id) {
|
2026-09-10 05:38:07 +00:00
|
|
|
num = SnowflakeUtilsDefault.extractTimestamp(id);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-07-23 10:11:24 +00:00
|
|
|
return WELCOME_STICKERS[num % WELCOME_STICKERS.length];
|
2026-07-20 16:05:17 +00:00
|
|
|
};
|
|
|
|
|
export const pickWelcomeSticker = function pickWelcomeSticker(id) {
|
2026-09-10 05:38:07 +00:00
|
|
|
const currentUser = UserStore.getCurrentUser();
|
2026-07-20 16:05:17 +00:00
|
|
|
id = undefined;
|
2026-07-29 08:29:29 +00:00
|
|
|
if (currentUser != null) {
|
2026-07-20 16:05:17 +00:00
|
|
|
id = currentUser.id;
|
|
|
|
|
}
|
|
|
|
|
let num = 0;
|
|
|
|
|
if (null != id) {
|
2026-09-10 05:38:07 +00:00
|
|
|
num = SnowflakeUtilsDefault.extractTimestamp(id);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
const obj2 = SnowflakeUtilsDefault;
|
2026-07-23 10:11:24 +00:00
|
|
|
return WELCOME_STICKERS[(num + obj2.extractTimestamp(obj2, id)) % WELCOME_STICKERS.length];
|
2026-07-20 16:05:17 +00:00
|
|
|
};
|
|
|
|
|
export const handleWelcomeCtaClicked = function handleWelcomeCtaClicked(messageChannel, message, stickerId) {
|
2026-09-10 05:38:07 +00:00
|
|
|
const obj = MessageActionCreatorsDefault;
|
|
|
|
|
obj.sendGreetMessage(messageChannel.id, stickerId, MessageActionCreatorsDefault.getSendMessageOptionsForReply({ channel: messageChannel, message, shouldMention: true, showMentionToggle: true }));
|
|
|
|
|
const obj3 = { channel: messageChannel, message, shouldMention: true, showMentionToggle: true };
|
|
|
|
|
const obj5 = { is_reply: true, sticker_id: stickerId, target_user: message.author.id, sender: null };
|
|
|
|
|
const currentUser = UserStore.getCurrentUser();
|
2026-07-20 16:05:17 +00:00
|
|
|
let id;
|
2026-07-29 08:29:29 +00:00
|
|
|
if (currentUser != null) {
|
2026-07-20 16:05:17 +00:00
|
|
|
id = currentUser.id;
|
|
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
obj5.sender = id;
|
|
|
|
|
AnalyticsUtilsDefault.track(AnalyticEvents.WELCOME_CTA_CLICKED, obj5);
|
2026-07-20 16:05:17 +00:00
|
|
|
};
|