2026-07-23 10:11:24 +00:00
// Module ID: 10218
// Function ID: 78845
2026-07-20 16:05:17 +00:00
// Name: _isNativeReflectConstruct
2026-07-23 10:11:24 +00:00
// Dependencies: [15, 17, 18, 6, 7, 1347, 4143, 10219, 5074, 6769, 1316, 1348, 1838, 10220, 4142, 1906, 1342, 1849, 653, 7704, 7702, 3712, 22, 10221, 10223, 5723, 5651, 10224, 10233, 4351, 10234, 664, 10235, 10236, 10229, 10238, 10239, 10243, 4321, 3803, 1282, 9535, 6829, 10244, 4324, 21, 566, 686, 2]
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
// Module 10218 (_isNativeReflectConstruct)
import _isNativeReflectConstruct from "_isNativeReflectConstruct" ;
import closure_4 from "_isNativeReflectConstruct" ;
import closure_5 from "ME" ;
import closure_6 from "_isNativeReflectConstruct" ;
import closure_7 from "_isNativeReflectConstruct" ;
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose" ;
import closure_9 from "_isNativeReflectConstruct" ;
import closure_10 from "_isNativeReflectConstruct" ;
import { trackMessageNotificationTimestamps as closure_11 } from "_isNativeReflectConstruct" ;
import importDefaultResult from "_isNativeReflectConstruct" ;
import closure_13 from "_isNativeReflectConstruct" ;
import closure_14 from "_isNativeReflectConstruct" ;
import closure_15 from "_createForOfIteratorHelperLoose" ;
import closure_16 from "_isNativeReflectConstruct" ;
import closure_17 from "_isNativeReflectConstruct" ;
import closure_18 from "_isNativeReflectConstruct" ;
import closure_19 from "_isNativeReflectConstruct" ;
import closure_20 from "_isNativeReflectConstruct" ;
import ME from "ME" ;
import { EMPTY_SCHEDULE_SNAPSHOT } from "_createForOfIteratorHelperLoose" ;
let closure_21 ;
let closure_22 ;
let closure_23 ;
let closure_24 ;
const require = arg1 ;
2026-07-20 16:05:17 +00:00
function _isNativeReflectConstruct() {
let closure_0 = ! valueOf . call ( Reflect . construct ( Boolean , [ ] , ( ) = > {
} ) ) ;
function _isNativeReflectConstruct() {
return closure_0 ;
}
const result = _isNativeReflectConstruct ( ) ;
}
2026-07-23 10:11:24 +00:00
function _createForOfIteratorHelperLoose ( iterable ) {
let closure_0 = iterable ;
iterable = "undefined" !== typeof Symbol ;
if ( iterable ) {
2026-07-20 16:05:17 +00:00
const _Symbol = Symbol ;
2026-07-23 10:11:24 +00:00
iterable = iterable [ Symbol . iterator ] ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if ( ! iterable ) {
iterable = iterable [ Symbol . iterator ] ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if ( iterable ) {
const iter = iterable . call ( iterable ) ;
2026-07-20 16:05:17 +00:00
const next = iter . next ;
return next . bind ( iter ) ;
} else {
const _Array = Array ;
2026-07-23 10:11:24 +00:00
let tmp = iterable ;
if ( ! Array . isArray ( iterable ) ) {
2026-07-20 16:05:17 +00:00
let tmp2 ;
2026-07-23 10:11:24 +00:00
if ( iterable ) {
if ( "string" === typeof iterable ) {
tmp2 = _arrayLikeToArray ( iterable , undefined ) ;
2026-07-20 16:05:17 +00:00
} else {
const toString = { } . toString ;
2026-07-23 10:11:24 +00:00
const substr = toString . call ( iterable ) . slice ( 8 , - 1 ) ;
2026-07-20 16:05:17 +00:00
let name = substr ;
if ( tmp3 ) {
2026-07-23 10:11:24 +00:00
name = iterable . constructor . name ;
2026-07-20 16:05:17 +00:00
}
if ( "Map" !== name ) {
if ( "Set" !== name ) {
if ( "Arguments" === name ) {
2026-07-23 10:11:24 +00:00
let arr = _arrayLikeToArray ( iterable , undefined ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
let obj = /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/ ;
2026-07-20 16:05:17 +00:00
}
}
tmp2 = arr ;
}
const _Array2 = Array ;
2026-07-23 10:11:24 +00:00
arr = Array . from ( iterable ) ;
const callResult = toString . call ( iterable ) ;
tmp3 = "Object" === substr && iterable . constructor ;
2026-07-20 16:05:17 +00:00
}
}
tmp = tmp2 ;
if ( ! tmp2 ) {
const _TypeError = TypeError ;
const typeError = new TypeError ( "Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." ) ;
throw typeError ;
}
}
if ( tmp ) {
2026-07-23 10:11:24 +00:00
closure_0 = tmp ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let c1 = 0 ;
2026-07-20 16:05:17 +00:00
return ( ) = > {
2026-07-23 10:11:24 +00:00
if ( closure_1 >= length . length ) {
2026-07-20 16:05:17 +00:00
let obj = { done : true } ;
} else {
obj = { done : false } ;
closure_1 = tmp3 + 1 ;
2026-07-23 10:11:24 +00:00
obj . value = length [ + closure_1 ] ;
2026-07-20 16:05:17 +00:00
}
return obj ;
} ;
}
}
function _arrayLikeToArray ( arg0 , arg1 ) {
let length ;
if ( tmp ) {
length = arg0 . length ;
}
const ArrayResult = Array ( length ) ;
for ( let num = 0 ; num < length ; num = num + 1 ) {
ArrayResult [ num ] = arg0 [ num ] ;
}
return ArrayResult ;
}
function handleAlertMessage() {
2026-07-23 10:11:24 +00:00
let obj = guild ( 10224 ) ;
2026-07-20 16:05:17 +00:00
if ( obj . allowInAppNotifications ( ) ) {
2026-07-23 10:11:24 +00:00
let obj1 = guild ( 10239 ) ;
2026-07-20 16:05:17 +00:00
const result = obj1 . shouldShowRaidInAppNotification ( ) ;
const guildId = result . guildId ;
if ( result . show ) {
if ( null != guildId ) {
2026-07-23 10:11:24 +00:00
guild = store2 . getGuild ( guildId ) ;
2026-07-20 16:05:17 +00:00
if ( null == guild ) {
return false ;
} else {
2026-07-23 10:11:24 +00:00
channel = store . getChannel ( channel ( 10243 ) ( guild ) ) ;
2026-07-20 16:05:17 +00:00
let tmp15 = null != channel ;
if ( tmp15 ) {
let tmp6 = channelId . getChannelId ( ) !== channel . id ;
if ( tmp6 ) {
obj = { guild , channel } ;
const tmp8 = ! tmp3 . wasRecentlyDismissed ( obj ) ;
if ( tmp8 ) {
obj = { } ;
obj1 = {
type : constants3 . ALERT ,
key : guildId ,
2026-07-23 10:11:24 +00:00
duration : 30 * channel ( 664 ) . Millis . SECOND ,
2026-07-20 16:05:17 +00:00
onDismiss() {
2026-07-23 10:11:24 +00:00
let obj = channel ( outer1_2 [ 32 ] ) ;
2026-07-20 16:05:17 +00:00
obj . clearNotification ( ) ;
obj = { guild , channel } ;
2026-07-23 10:11:24 +00:00
outer1_25 . dismissNotification ( obj ) ;
2026-07-20 16:05:17 +00:00
} ,
channel ,
guild ,
2026-07-23 10:11:24 +00:00
inAppNotificationId : guild ( 10236 ) . generateInAppNotificationId ( )
2026-07-20 16:05:17 +00:00
} ;
obj . notification = obj1 ;
handleEnqueueNotification ( obj ) ;
2026-07-23 10:11:24 +00:00
const obj6 = guild ( 10236 ) ;
2026-07-20 16:05:17 +00:00
}
tmp6 = tmp8 ;
}
tmp15 = tmp6 ;
}
return tmp15 ;
}
}
}
return false ;
} else {
return false ;
}
}
function getCurrentRestrictedSchedule() {
const currentUser = authStore . getCurrentUser ( ) ;
let restrictedSchedule ;
if ( null != currentUser ) {
restrictedSchedule = currentUser . restrictedSchedule ;
}
let tmp3 = null ;
if ( null != restrictedSchedule ) {
tmp3 = null ;
if ( 0 !== restrictedSchedule . rules . length ) {
tmp3 = restrictedSchedule ;
}
}
return tmp3 ;
}
function handleEnqueueNotification ( notification ) {
let channelId ;
let guildId ;
let messageId ;
notification = notification . notification ;
if ( closure_28 ) {
trackDismissed ( notification , "restricted_hours" ) ;
return false ;
} else {
2026-07-23 10:11:24 +00:00
let obj = require ( 10236 ) /* hasMedia */ ;
2026-07-20 16:05:17 +00:00
const result = obj . extractMetadataFromNotification ( notification ) ;
( { guildId , channelId , messageId } = result ) ;
obj = { type : notification . type , guild_id : guildId , channel_id : channelId , in_app_notification_id : notification.inAppNotificationId , message_id : messageId } ;
2026-07-23 10:11:24 +00:00
importDefault ( 4324 ) . trackWithMetadata ( constants . IN_APP_NOTIFICATION_CREATED , obj ) ;
2026-07-20 16:05:17 +00:00
constants . enqueue ( notification ) ;
2026-07-23 10:11:24 +00:00
const obj2 = importDefault ( 4324 ) ;
const result1 = require ( 10244 ) /* playInAppMessageSound */ . playInAppMessageSound ( notification ) ;
if ( null == c26 ) {
2026-07-20 16:05:17 +00:00
showNextNotification ( ) ;
}
}
}
function trackDismissed ( type , dismiss_reason ) {
let channelId ;
let guildId ;
let messageId ;
2026-07-23 10:11:24 +00:00
let obj = require ( 10236 ) /* hasMedia */ ;
2026-07-20 16:05:17 +00:00
const result = obj . extractMetadataFromNotification ( type ) ;
( { guildId , channelId , messageId } = result ) ;
obj = { type : type . type , guild_id : guildId , channel_id : channelId , message_id : messageId , dismiss_reason , in_app_notification_id : type.inAppNotificationId } ;
2026-07-23 10:11:24 +00:00
importDefault ( 4324 ) . trackWithMetadata ( constants . IN_APP_NOTIFICATION_DISMISSED , obj ) ;
2026-07-20 16:05:17 +00:00
}
function showNextNotification() {
let closure_26 = tmp5 . tryDrain ( ) ;
}
function rejectNotifications ( predicate ) {
tmp5 . removeAll ( predicate ) ;
2026-07-23 10:11:24 +00:00
if ( null != c26 ) {
if ( predicate ( c26 ) ) {
c26 = null ;
2026-07-20 16:05:17 +00:00
showNextNotification ( ) ;
2026-07-23 10:11:24 +00:00
tmp5 = showNextNotification ;
2026-07-20 16:05:17 +00:00
}
return true ;
}
2026-07-23 10:11:24 +00:00
if ( null != c26 ) {
2026-07-20 16:05:17 +00:00
return false ;
} else {
showNextNotification ( ) ;
}
}
2026-07-23 10:11:24 +00:00
( { AnalyticEvents : closure_21 , ChannelTypes : closure_22 , InAppNotificationTypes : closure_23 , MessageTypesSets : closure_24 } = ME ) ;
let tmp3 = ( ( ) = > {
2026-07-20 16:05:17 +00:00
class AlertDismissalHandler {
constructor ( ) {
2026-07-23 10:11:24 +00:00
tmp = outer1_6 ( this , AlertDismissalHandler ) ;
2026-07-20 16:05:17 +00:00
obj = { } ;
map = new Map ( ) ;
2026-07-23 10:11:24 +00:00
obj [ AlertDismissalHandler ( outer1_2 [ 19 ] ) . GuildIncidentAlertTypes . JOIN_RAID ] = map ;
2026-07-20 16:05:17 +00:00
map1 = new Map ( ) ;
2026-07-23 10:11:24 +00:00
obj [ AlertDismissalHandler ( outer1_2 [ 19 ] ) . GuildIncidentAlertTypes . DM_RAID ] = map1 ;
2026-07-20 16:05:17 +00:00
this . dissmissedAlertsMap = obj ;
2026-07-23 10:11:24 +00:00
this . threshold = { amount : 1 , unitOfTime : "hour" } ;
2026-07-20 16:05:17 +00:00
return ;
}
}
let obj = {
key : "key" ,
value ( guild ) {
return guild . guild . id + guild . channel . id ;
}
} ;
const items = [ obj , , ] ;
obj = {
key : "dismissNotification" ,
value ( guild ) {
const self = this ;
guild = guild . guild ;
2026-07-23 10:11:24 +00:00
let obj = AlertDismissalHandler ( outer1_2 [ 20 ] ) ;
const incidentAlertType = obj . getIncidentAlertType ( outer1_10 . getGuildIncident ( guild . id ) ) ;
2026-07-20 16:05:17 +00:00
if ( null != incidentAlertType ) {
obj = { guild , channel : guild.channel } ;
2026-07-23 10:11:24 +00:00
const result = self . dissmissedAlertsMap [ incidentAlertType ] . set ( self . key ( obj ) , outer1_1 ( outer1_2 [ 21 ] ) ( ) ) ;
2026-07-20 16:05:17 +00:00
const keyResult = self . key ( obj ) ;
const obj3 = self . dissmissedAlertsMap [ incidentAlertType ] ;
}
}
} ;
items [ 1 ] = obj ;
obj = {
key : "wasRecentlyDismissed" ,
value ( guild ) {
const self = this ;
guild = guild . guild ;
2026-07-23 10:11:24 +00:00
let obj = AlertDismissalHandler ( outer1_2 [ 20 ] ) ;
const incidentAlertType = obj . getIncidentAlertType ( outer1_10 . getGuildIncident ( guild . id ) ) ;
2026-07-20 16:05:17 +00:00
if ( null == incidentAlertType ) {
return false ;
} else {
obj = { guild , channel : guild.channel } ;
const value = self . dissmissedAlertsMap [ incidentAlertType ] . get ( self . key ( obj ) ) ;
let tmp4 = undefined !== value ;
if ( tmp4 ) {
2026-07-23 10:11:24 +00:00
tmp4 = outer1_1 ( outer1_2 [ 21 ] ) ( ) . diff ( outer1_1 ( outer1_2 [ 21 ] ) ( value ) , self . threshold . unitOfTime ) < self . threshold . amount ;
const obj2 = outer1_1 ( outer1_2 [ 21 ] ) ( ) ;
2026-07-20 16:05:17 +00:00
}
return tmp4 ;
}
}
} ;
items [ 2 ] = obj ;
return callback2 ( AlertDismissalHandler , items ) ;
2026-07-23 10:11:24 +00:00
} ) ( ) ;
2026-07-20 16:05:17 +00:00
tmp3 = new tmp3 ( ) ;
2026-07-23 10:11:24 +00:00
let closure_25 = tmp3 ;
let c26 = null ;
let tmp5 = ( ( ) = > {
2026-07-20 16:05:17 +00:00
class NotificationQueue {
constructor ( ) {
2026-07-23 10:11:24 +00:00
tmp = outer1_6 ( this , NotificationQueue ) ;
2026-07-20 16:05:17 +00:00
this . queue = [ ] ;
return ;
}
}
let obj = {
key : "enqueue" ,
value ( arg0 ) {
const self = this ;
if ( this . isFull ( ) ) {
const queue = self . queue ;
let arr = queue . shift ( ) ;
if ( null != arr ) {
2026-07-23 10:11:24 +00:00
outer1_37 ( arr , "evicted_from_queue" ) ;
2026-07-20 16:05:17 +00:00
}
}
const queue1 = self . queue ;
arr = queue1 . push ( arg0 ) ;
}
} ;
const items = [ obj , , , ] ;
obj = {
key : "tryDrain" ,
value() {
const queue = this . queue ;
return queue . shift ( ) ;
}
} ;
items [ 1 ] = obj ;
obj = {
key : "isFull" ,
value() {
return this . queue . length >= 2 ;
}
} ;
items [ 2 ] = obj ;
items [ 3 ] = {
key : "removeAll" ,
value ( arg0 ) {
let done ;
2026-07-23 10:11:24 +00:00
const tmp = outer1_32 ( outer1_1 ( outer1_2 [ 22 ] ) . remove ( this . queue , arg0 ) ) ;
2026-07-20 16:05:17 +00:00
let iter = tmp ( ) ;
if ( ! iter . done ) {
do {
2026-07-23 10:11:24 +00:00
let tmp2 = outer1_37 ;
let tmp3 = outer1_37 ( iter . value , "rejected_from_queue" ) ;
2026-07-20 16:05:17 +00:00
let iter2 = tmp ( ) ;
iter = iter2 ;
done = iter2 . done ;
} while ( ! done ) ;
}
}
} ;
return callback2 ( NotificationQueue , items ) ;
2026-07-23 10:11:24 +00:00
} ) ( ) ;
2026-07-20 16:05:17 +00:00
tmp5 = new tmp5 ( ) ;
2026-07-23 10:11:24 +00:00
let closure_27 = tmp5 ;
2026-07-20 16:05:17 +00:00
let closure_28 = importDefaultResult . isCurrentUserInRestrictedHours ( ) ;
2026-07-23 10:11:24 +00:00
let c29 = false ;
let tmp7 = ( ( Store ) = > {
2026-07-20 16:05:17 +00:00
class InAppNotificationStore {
constructor ( ) {
self = this ;
2026-07-23 10:11:24 +00:00
tmp = outer1_6 ( this , InAppNotificationStore ) ;
obj = outer1_4 ( InAppNotificationStore ) ;
tmp2 = outer1_3 ;
if ( outer1_31 ( ) ) {
2026-07-20 16:05:17 +00:00
tmp6 = globalThis ;
_Reflect = Reflect ;
2026-07-23 10:11:24 +00:00
tmp7 = outer1_4 ;
2026-07-20 16:05:17 +00:00
tmp8 = arguments ;
2026-07-23 10:11:24 +00:00
constructResult = Reflect . construct ( obj , arguments , outer1_4 ( self ) . constructor ) ;
2026-07-20 16:05:17 +00:00
} else {
tmp3 = arguments ;
tmp4 = arguments ;
constructResult = obj ( . . . arguments ) ;
}
return tmp2 ( self , constructResult ) ;
}
}
callback ( InAppNotificationStore , Store ) ;
let obj = {
key : "initialize" ,
value() {
2026-07-23 10:11:24 +00:00
this . waitFor ( outer1_9 , outer1_14 , outer1_8 , outer1_12 , outer1_10 , outer1_15 , outer1_16 , outer1_17 , outer1_18 , outer1_19 , outer1_13 , outer1_20 ) ;
const items = [ outer1_10 ] ;
this . syncWith ( items , outer1_34 ) ;
2026-07-20 16:05:17 +00:00
}
} ;
2026-07-23 10:11:24 +00:00
let items = [ obj , ] ;
2026-07-20 16:05:17 +00:00
obj = {
key : "getCurrentNotification" ,
value() {
2026-07-23 10:11:24 +00:00
return outer1_26 ;
2026-07-20 16:05:17 +00:00
}
} ;
items [ 1 ] = obj ;
return callback2 ( InAppNotificationStore , items ) ;
2026-07-23 10:11:24 +00:00
} ) ( require ( "initialize" ) . Store ) ;
2026-07-20 16:05:17 +00:00
tmp7 . displayName = "InAppNotificationStore" ;
2026-07-23 10:11:24 +00:00
tmp7 = new tmp7 ( require ( "dispatcher" ) , {
2026-07-20 16:05:17 +00:00
POST_CONNECTION_OPEN : function handlePostConnectionOpen() {
2026-07-23 10:11:24 +00:00
let c29 = true ;
let closure_30 = require ( 10221 ) /* _createForOfIteratorHelperLoose */ . toScheduleSnapshot ( getCurrentRestrictedSchedule ( ) ) ;
2026-07-20 16:05:17 +00:00
handleAlertMessage ( ) ;
} ,
LOGOUT : function handleLogout() {
2026-07-23 10:11:24 +00:00
let c29 = false ;
const EMPTY_SCHEDULE_SNAPSHOT = require ( 10221 ) /* _createForOfIteratorHelperLoose */ . EMPTY_SCHEDULE_SNAPSHOT ;
let c26 = null ;
2026-07-20 16:05:17 +00:00
tmp5 . removeAll ( ( ) = > true ) ;
} ,
GUILD_UPDATE : handleAlertMessage ,
MESSAGE_CREATE : function handleIncomingMessage ( message ) {
message = message . message ;
const channel_id = message . channel_id ;
2026-07-23 10:11:24 +00:00
let obj = require ( 10223 ) /* canViewPotentiallyNSFWChannel */ ;
2026-07-20 16:05:17 +00:00
if ( obj . canViewPotentiallyNSFWChannel ( channel_id ) ) {
if ( obj2 . shouldShowSpoilerGateForChannelId ( channel_id ) ) {
return false ;
} else {
2026-07-23 10:11:24 +00:00
if ( importDefault ( 5651 ) ( message ) ) {
2026-07-20 16:05:17 +00:00
const SELF_MENTIONABLE_SYSTEM = constants4 . SELF_MENTIONABLE_SYSTEM ;
if ( ! SELF_MENTIONABLE_SYSTEM . has ( message . type ) ) {
return false ;
}
}
if ( ! message . optimistic ) {
if ( obj3 . allowInAppNotifications ( ) ) {
if ( ! obj4 . isEnabled ( ) ) {
2026-07-21 06:55:02 +00:00
if ( ! uiStore . getChatOpen ( channel_id ) ) {
2026-07-23 10:11:24 +00:00
const result = require ( 10224 ) /* _createForOfIteratorHelperLoose */ . shouldIncludeSelectedChannel ( ) ;
const obj5 = require ( 10224 ) /* _createForOfIteratorHelperLoose */ ;
2026-07-20 16:05:17 +00:00
if ( obj6 . shouldNotify ( message , channel_id , result ) ) {
const channel = store . getChannel ( channel_id ) ;
if ( null == channel ) {
return false ;
} else {
2026-07-23 10:11:24 +00:00
const messageRecord = require ( 4351 ) /* createMinimalMessageRecord */ . createMessageRecord ( message ) ;
const obj11 = require ( 4351 ) /* createMinimalMessageRecord */ ;
2026-07-20 16:05:17 +00:00
if ( obj12 . isMessageContentPreviewable ( messageRecord ) ) {
callback3 ( message , channel . guild_id ) ;
obj = { } ;
obj = {
type : constants3 . MESSAGE ,
guild : store2.getGuild ( channel . getGuildId ( ) ) ,
channel ,
message : messageRecord ,
key : messageRecord.id ,
2026-07-23 10:11:24 +00:00
duration : 5 * importDefault ( 664 ) . Millis . SECOND ,
2026-07-20 16:05:17 +00:00
onDismiss() {
2026-07-23 10:11:24 +00:00
outer1_1 ( outer1_2 [ 32 ] ) . clearNotification ( ) ;
2026-07-20 16:05:17 +00:00
} ,
parentChannel : store.getChannel ( channel . parent_id ) ,
2026-07-23 10:11:24 +00:00
inAppNotificationId : require ( 10236 ) /* hasMedia */ . generateInAppNotificationId ( ) ,
2026-07-20 16:05:17 +00:00
mentionCount : mentionCount.getMentionCount ( channel . id )
} ;
obj . notification = obj ;
handleEnqueueNotification ( obj ) ;
} else {
return false ;
}
2026-07-23 10:11:24 +00:00
obj12 = require ( 10234 ) /* isMessageContentPreviewable */ ;
2026-07-20 16:05:17 +00:00
}
} else {
return false ;
}
2026-07-23 10:11:24 +00:00
obj6 = require ( 10224 ) /* _createForOfIteratorHelperLoose */ ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
obj4 = importDefault ( 10233 ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
obj3 = require ( 10224 ) /* _createForOfIteratorHelperLoose */ ;
2026-07-20 16:05:17 +00:00
}
return false ;
}
2026-07-23 10:11:24 +00:00
obj2 = require ( 5723 ) /* getSpoilerGatingChannelId */ ;
2026-07-20 16:05:17 +00:00
} else {
return false ;
}
} ,
MESSAGE_REQUEST_NOTIFICATION_SENT : function handleMessageRequest ( triggeringUserId ) {
triggeringUserId = triggeringUserId . triggeringUserId ;
2026-07-23 10:11:24 +00:00
let obj = importDefault ( 10238 ) ;
2026-07-20 16:05:17 +00:00
if ( obj . getConfig ( { location : "inAppNotificationStore" } ) . enabled ) {
const user = authStore . getUser ( triggeringUserId ) ;
if ( null == user ) {
return false ;
} else {
obj = { } ;
obj = { type : constants3 . MESSAGE_REQUEST , author : user , numMutualGuilds : triggeringUserId.numMutualGuilds } ;
const _HermesInternal = HermesInternal ;
obj . key = "message-request-" + triggeringUserId ;
2026-07-23 10:11:24 +00:00
obj . duration = 5 * importDefault ( 664 ) . Millis . SECOND ;
2026-07-20 16:05:17 +00:00
obj . onDismiss = function onDismiss() {
2026-07-23 10:11:24 +00:00
outer1_1 ( outer1_2 [ 32 ] ) . clearNotification ( ) ;
2026-07-20 16:05:17 +00:00
} ;
2026-07-23 10:11:24 +00:00
obj . inAppNotificationId = require ( 10236 ) /* hasMedia */ . generateInAppNotificationId ( ) ;
2026-07-20 16:05:17 +00:00
obj . notification = obj ;
handleEnqueueNotification ( obj ) ;
}
} else {
return false ;
}
} ,
MESSAGE_ACK : function handleMessageAck ( arg0 ) {
2026-07-23 10:11:24 +00:00
let importDefault ;
let require ;
( { channelId : require , messageId : importDefault } = arg0 ) ;
function predicate ( c26 ) {
let tmp = c26 . type === outer1_23 . MESSAGE ;
2026-07-20 16:05:17 +00:00
if ( tmp ) {
2026-07-23 10:11:24 +00:00
tmp = c26 . channel . id === closure_0 ;
2026-07-20 16:05:17 +00:00
}
if ( tmp ) {
2026-07-23 10:11:24 +00:00
tmp = outer1_1 ( outer1_2 [ 45 ] ) . compare ( c26 . message . id , closure_1 ) <= 0 ;
const obj = outer1_1 ( outer1_2 [ 45 ] ) ;
2026-07-20 16:05:17 +00:00
}
return tmp ;
}
2026-07-23 10:11:24 +00:00
let predicateResult = null != c26 ;
2026-07-20 16:05:17 +00:00
if ( predicateResult ) {
2026-07-23 10:11:24 +00:00
predicateResult = predicate ( c26 ) ;
2026-07-20 16:05:17 +00:00
}
if ( predicateResult ) {
2026-07-23 10:11:24 +00:00
trackDismissed ( c26 , "message_acked" ) ;
2026-07-20 16:05:17 +00:00
}
return rejectNotifications ( predicate ) ;
} ,
REACTION_NOTIFICATION_SENT : function handleReactionNotification ( arg0 ) {
let channelId ;
let emoji ;
let guildId ;
let message ;
( { message , emoji } = arg0 ) ;
if ( null != message ) {
if ( null != message . reactions ) {
if ( null != emoji ) {
2026-07-21 06:55:02 +00:00
if ( obj13 . allowInAppNotifications ( ) ) {
2026-07-23 10:11:24 +00:00
let obj = emoji ( 4321 ) ;
2026-07-20 16:05:17 +00:00
let tryParseChannelPathResult = obj . tryParseChannelPath ( tmp ) ;
if ( null == tryParseChannelPathResult ) {
2026-07-23 10:11:24 +00:00
tryParseChannelPathResult = { channelId : null , guildId : null } ;
2026-07-20 16:05:17 +00:00
}
( { channelId , guildId } = tryParseChannelPathResult ) ;
if ( null != channelId ) {
if ( null != guildId ) {
2026-07-23 10:11:24 +00:00
const ReactionNotifications = emoji ( 3803 ) . ReactionNotifications ;
2026-07-20 16:05:17 +00:00
const setting = ReactionNotifications . getSetting ( ) ;
2026-07-23 10:11:24 +00:00
if ( setting === emoji ( 1282 ) . ReactionNotificationType . NOTIFICATIONS_DISABLED ) {
2026-07-20 16:05:17 +00:00
return false ;
} else {
const channel = store . getChannel ( channelId ) ;
let type ;
if ( null != channel ) {
type = channel . type ;
}
let result = null != type ;
if ( result ) {
result = channel . type === constants2 . GUILD_ANNOUNCEMENT ;
}
if ( null != channel ) {
type = channel . type ;
}
if ( ! result ) {
result = obj3 . isReactionMilestoneNotification ( message . reactions , type ) ;
}
const guild = store2 . getGuild ( guildId ) ;
const user = authStore . getUser ( tmp2 ) ;
if ( null != channel ) {
2026-07-21 06:55:02 +00:00
if ( ! obj4 . isEnabled ( ) ) {
if ( ! uiStore . getChatOpen ( channelId ) ) {
2026-07-23 10:11:24 +00:00
const result1 = emoji ( 10224 ) . shouldIncludeSelectedChannel ( ) ;
const obj5 = emoji ( 10224 ) ;
2026-07-21 06:55:02 +00:00
obj = { message , channel , reactor : user , includeSelectedChannel : result1 } ;
if ( obj6 . shouldNotifyForReaction ( obj ) ) {
2026-07-23 10:11:24 +00:00
const messageRecord = emoji ( 4351 ) . createMessageRecord ( message ) ;
const obj8 = emoji ( 4351 ) ;
2026-07-21 06:55:02 +00:00
if ( obj9 . isMessageContentPreviewable ( messageRecord ) ) {
const reactions = message . reactions ;
const found = reactions . find ( ( emoji ) = > {
let tmp = emoji . emoji . id === emoji . id ;
if ( tmp ) {
tmp = null != emoji . id ;
}
if ( ! tmp ) {
tmp = emoji . emoji . name === emoji . name ;
}
return tmp ;
} ) ;
let tmp25 ;
if ( null != found ) {
tmp25 = found ;
}
if ( null == tmp25 ) {
if ( tmp10 ) {
return false ;
}
}
obj = { } ;
const obj1 = {
type : constants3 . REACTION ,
key : channelId ,
2026-07-23 10:11:24 +00:00
duration : 5 * importDefault ( 664 ) . Millis . SECOND ,
2026-07-21 06:55:02 +00:00
onDismiss() {
2026-07-23 10:11:24 +00:00
outer1_1 ( outer1_2 [ 32 ] ) . clearNotification ( ) ;
2026-07-21 06:55:02 +00:00
} ,
channel ,
guild ,
user ,
message : messageRecord ,
parentChannel : store.getChannel ( channel . parent_id ) ,
reaction : tmp25 ,
2026-07-23 10:11:24 +00:00
inAppNotificationId : emoji ( 10236 ) . generateInAppNotificationId ( )
2026-07-21 06:55:02 +00:00
} ;
obj . notification = obj1 ;
handleEnqueueNotification ( obj ) ;
} else {
2026-07-20 16:05:17 +00:00
return false ;
}
2026-07-23 10:11:24 +00:00
obj9 = emoji ( 10234 ) ;
2026-07-21 06:55:02 +00:00
} else {
return false ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
obj6 = emoji ( 10224 ) ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-21 06:55:02 +00:00
return false ;
2026-07-20 16:05:17 +00:00
}
return false ;
}
}
}
return false ;
}
2026-07-23 10:11:24 +00:00
obj13 = emoji ( 10224 ) ;
2026-07-20 16:05:17 +00:00
}
}
}
return false ;
} ,
MESSAGE_REMINDER_DUE : function handleMessageReminderDue ( savedMessage ) {
savedMessage = savedMessage . savedMessage ;
2026-07-23 10:11:24 +00:00
let obj = importDefault ( 9535 ) ;
2026-07-20 16:05:17 +00:00
if ( obj . getConfig ( { location : "inAppNotificationStore" } ) . enabled ) {
if ( null != savedMessage . message ) {
const channel = store . getChannel ( savedMessage . saveData . channelId ) ;
if ( null != channel ) {
const _HermesInternal = HermesInternal ;
obj = { } ;
obj = {
type : constants3 . MESSAGE_REMINDER ,
key : "" + savedMessage . saveData . channelId + "-" + savedMessage . saveData . messageId ,
2026-07-23 10:11:24 +00:00
duration : 10 * importDefault ( 664 ) . Millis . SECOND ,
2026-07-20 16:05:17 +00:00
onDismiss() {
2026-07-23 10:11:24 +00:00
outer1_1 ( outer1_2 [ 32 ] ) . clearNotification ( ) ;
2026-07-20 16:05:17 +00:00
} ,
channel ,
author : savedMessage.message.author ,
savedMessage ,
2026-07-23 10:11:24 +00:00
inAppNotificationId : require ( 10236 ) /* hasMedia */ . generateInAppNotificationId ( )
2026-07-20 16:05:17 +00:00
} ;
obj . notification = obj ;
handleEnqueueNotification ( obj ) ;
2026-07-23 10:11:24 +00:00
const obj4 = require ( 10236 ) /* hasMedia */ ;
2026-07-20 16:05:17 +00:00
}
}
}
} ,
RESTRICTED_HOURS_WARNING : function handleRestrictedHoursWarning ( arg0 ) {
let subtitle ;
let title ;
( { title , subtitle } = arg0 ) ;
2026-07-23 10:11:24 +00:00
let obj = require ( 6829 ) /* apexExperiment */ ;
2026-07-20 16:05:17 +00:00
const tmp = ! obj . getIsFamilyCenterV3Enabled ( { location : "InAppNotificationStore" } ) ;
let tmp2 = ! tmp ;
if ( ! tmp ) {
if ( ! ! obj . screenDowntimeReminder ) {
obj = { } ;
obj = {
type : constants3 . RESTRICTED_HOURS_WARNING ,
key : "restricted-hours-warning" ,
2026-07-23 10:11:24 +00:00
duration : 10 * importDefault ( 664 ) . Millis . SECOND ,
2026-07-20 16:05:17 +00:00
onDismiss() {
2026-07-23 10:11:24 +00:00
outer1_1 ( outer1_2 [ 32 ] ) . clearNotification ( ) ;
2026-07-20 16:05:17 +00:00
} ,
title ,
subtitle ,
2026-07-23 10:11:24 +00:00
inAppNotificationId : require ( 10236 ) /* hasMedia */ . generateInAppNotificationId ( )
2026-07-20 16:05:17 +00:00
} ;
obj . notification = obj ;
handleEnqueueNotification ( obj ) ;
2026-07-23 10:11:24 +00:00
const obj4 = require ( 10236 ) /* hasMedia */ ;
2026-07-20 16:05:17 +00:00
}
tmp2 = ! ! obj . screenDowntimeReminder ;
const tmp5 = ! ! obj . screenDowntimeReminder ;
}
return tmp2 ;
} ,
RESTRICTED_HOURS_STATE_CHANGE : function handleRestrictedHoursStateChange ( isInRestrictedHours ) {
isInRestrictedHours = isInRestrictedHours . isInRestrictedHours ;
if ( isInRestrictedHours ) {
2026-07-23 10:11:24 +00:00
if ( null != c26 ) {
trackDismissed ( c26 , "restricted_hours" ) ;
2026-07-20 16:05:17 +00:00
}
rejectNotifications ( ( ) = > true ) ;
} else {
return false ;
}
} ,
THREAD_CREATE : function handleThreadCreate ( channel ) {
channel = channel . channel ;
channel = store . getChannel ( channel . parent_id ) ;
if ( null != channel ) {
if ( channel . isForumLikeChannel ( ) ) {
if ( channel . isNewlyCreated ) {
if ( obj2 . allowInAppNotifications ( ) ) {
2026-07-23 10:11:24 +00:00
const obj3 = require ( 10224 ) /* _createForOfIteratorHelperLoose */ ;
2026-07-20 16:05:17 +00:00
if ( obj3 . shouldNotifyForForumThreadCreation ( channel , channel , ! obj4 . isChannelFocused ( ) ) ) {
const user = authStore . getUser ( channel . ownerId ) ;
if ( null == user ) {
return false ;
} else {
const guild = store2 . getGuild ( channel . guild_id ) ;
if ( null == guild ) {
return false ;
} else {
let obj = { } ;
obj = {
type : constants3 . FORUM_THREAD_CREATED ,
thread : channel ,
threadCreator : user ,
parentChannel : channel ,
guild ,
key : channel.id ,
2026-07-23 10:11:24 +00:00
duration : 5 * importDefault ( 664 ) . Millis . SECOND ,
2026-07-20 16:05:17 +00:00
onDismiss() {
2026-07-23 10:11:24 +00:00
outer1_1 ( outer1_2 [ 32 ] ) . clearNotification ( ) ;
2026-07-20 16:05:17 +00:00
} ,
2026-07-23 10:11:24 +00:00
inAppNotificationId : require ( 10236 ) /* hasMedia */ . generateInAppNotificationId ( )
2026-07-20 16:05:17 +00:00
} ;
obj . notification = obj ;
handleEnqueueNotification ( obj ) ;
}
}
}
2026-07-23 10:11:24 +00:00
obj4 = require ( 10229 ) /* getFocusedChannelId */ ;
2026-07-20 16:05:17 +00:00
}
return false ;
} else {
return false ;
}
}
}
return false ;
} ,
CLEAR_IN_APP_NOTIFICATION : function handleClearInAppNotification() {
2026-07-23 10:11:24 +00:00
let c26 = null ;
2026-07-20 16:05:17 +00:00
showNextNotification ( ) ;
} ,
ENQUEUE_IN_APP_NOTIFICATION : handleEnqueueNotification ,
CHANNEL_SELECT : function handleChannelSelect ( channelId ) {
2026-07-23 10:11:24 +00:00
channelId = channelId . channelId ;
function predicate ( c26 ) {
let tmp = c26 . type === outer1_23 . MESSAGE ;
2026-07-20 16:05:17 +00:00
if ( tmp ) {
2026-07-23 10:11:24 +00:00
tmp = c26 . channel . id === channelId ;
2026-07-20 16:05:17 +00:00
}
if ( ! tmp ) {
2026-07-23 10:11:24 +00:00
let tmp4 = c26 . type === outer1_23 . MESSAGE_FAILED_TO_SEND ;
2026-07-20 16:05:17 +00:00
if ( tmp4 ) {
2026-07-23 10:11:24 +00:00
tmp4 = c26 . channelId === channelId ;
2026-07-20 16:05:17 +00:00
}
tmp = tmp4 ;
}
if ( ! tmp ) {
2026-07-23 10:11:24 +00:00
let tmp7 = c26 . type === outer1_23 . ALERT ;
2026-07-20 16:05:17 +00:00
if ( tmp7 ) {
2026-07-23 10:11:24 +00:00
tmp7 = c26 . channel . id === channelId ;
2026-07-20 16:05:17 +00:00
}
tmp = tmp7 ;
}
return tmp ;
}
2026-07-23 10:11:24 +00:00
let predicateResult = null != c26 ;
2026-07-20 16:05:17 +00:00
if ( predicateResult ) {
2026-07-23 10:11:24 +00:00
predicateResult = predicate ( c26 ) ;
2026-07-20 16:05:17 +00:00
}
if ( predicateResult ) {
2026-07-23 10:11:24 +00:00
trackDismissed ( c26 , "notification_clicked" ) ;
2026-07-20 16:05:17 +00:00
}
return rejectNotifications ( predicate ) ;
} ,
CHANNEL_RTC_UPDATE_CHAT_OPEN : function handleVoiceChatOpen ( arg0 ) {
2026-07-23 10:11:24 +00:00
let importDefault ;
let require ;
( { channelId : require , chatOpen : importDefault } = arg0 ) ;
function predicate ( c26 ) {
let tmp = c26 . type === outer1_23 . MESSAGE ;
2026-07-20 16:05:17 +00:00
if ( tmp ) {
2026-07-23 10:11:24 +00:00
tmp = c26 . channel . id === closure_0 ;
2026-07-20 16:05:17 +00:00
}
if ( tmp ) {
tmp = closure_1 ;
}
return tmp ;
}
2026-07-23 10:11:24 +00:00
let predicateResult = null != c26 ;
2026-07-20 16:05:17 +00:00
if ( predicateResult ) {
2026-07-23 10:11:24 +00:00
predicateResult = predicate ( c26 ) ;
2026-07-20 16:05:17 +00:00
}
if ( predicateResult ) {
2026-07-23 10:11:24 +00:00
trackDismissed ( c26 , "notification_clicked" ) ;
2026-07-20 16:05:17 +00:00
}
return rejectNotifications ( predicate ) ;
} ,
USER_SETTINGS_PROTO_UPDATE : function handleUserSettingsUpdate() {
2026-07-23 10:11:24 +00:00
let flag = ! require ( 10224 ) /* _createForOfIteratorHelperLoose */ . allowInAppNotifications ( ) ;
2026-07-20 16:05:17 +00:00
if ( flag ) {
2026-07-23 10:11:24 +00:00
if ( null != c26 ) {
const tmp5 = trackDismissed ( c26 , "settings_updated" ) ;
c26 = null ;
2026-07-20 16:05:17 +00:00
}
tmp5 . removeAll ( ( ) = > true ) ;
flag = true ;
}
return flag ;
} ,
CURRENT_USER_UPDATE : function handleCurrentUserUpdate() {
2026-07-23 10:11:24 +00:00
if ( c29 ) {
let obj = require ( 6829 ) /* apexExperiment */ ;
2026-07-20 16:05:17 +00:00
obj = { location : "InAppNotificationStore" } ;
if ( obj . getIsFamilyCenterV3Enabled ( obj ) ) {
2026-07-23 10:11:24 +00:00
const toScheduleSnapshotResult = require ( 10221 ) /* _createForOfIteratorHelperLoose */ . toScheduleSnapshot ( getCurrentRestrictedSchedule ( ) ) ;
2026-07-20 16:05:17 +00:00
const EMPTY_SCHEDULE_SNAPSHOT = toScheduleSnapshotResult ;
2026-07-23 10:11:24 +00:00
const obj3 = require ( 10221 ) /* _createForOfIteratorHelperLoose */ ;
const diffSchedulesResult = require ( 10221 ) /* _createForOfIteratorHelperLoose */ . diffSchedules ( EMPTY_SCHEDULE_SNAPSHOT , toScheduleSnapshotResult ) ;
2026-07-20 16:05:17 +00:00
let setting = null != diffSchedulesResult ;
if ( setting ) {
2026-07-23 10:11:24 +00:00
const EnableScreenDowntimeScheduleNotifications = require ( 3803 ) /* explicitContentFromProto */ . EnableScreenDowntimeScheduleNotifications ;
2026-07-20 16:05:17 +00:00
setting = EnableScreenDowntimeScheduleNotifications . getSetting ( ) ;
}
if ( setting ) {
2026-07-23 10:11:24 +00:00
setting = require ( 10224 ) /* _createForOfIteratorHelperLoose */ . allowInAppNotifications ( ) ;
const obj5 = require ( 10224 ) /* _createForOfIteratorHelperLoose */ ;
2026-07-20 16:05:17 +00:00
}
if ( setting ) {
obj = { } ;
const obj1 = {
type : constants3 . RESTRICTED_SCHEDULE_UPDATED ,
2026-07-23 10:11:24 +00:00
key : require ( 10221 ) /* _createForOfIteratorHelperLoose */ . restrictedScheduleNotificationKey ( diffSchedulesResult . kind ) ,
duration : 7 * importDefault ( 664 ) . Millis . SECOND ,
2026-07-20 16:05:17 +00:00
onDismiss() {
2026-07-23 10:11:24 +00:00
outer1_1 ( outer1_2 [ 32 ] ) . clearNotification ( ) ;
2026-07-20 16:05:17 +00:00
}
} ;
2026-07-23 10:11:24 +00:00
const obj8 = require ( 10221 ) /* _createForOfIteratorHelperLoose */ ;
obj1 . title = require ( 10221 ) /* _createForOfIteratorHelperLoose */ . getRestrictedScheduleNotificationTitle ( diffSchedulesResult . kind ) ;
const obj9 = require ( 10221 ) /* _createForOfIteratorHelperLoose */ ;
obj1 . subtitle = require ( 10221 ) /* _createForOfIteratorHelperLoose */ . getRestrictedScheduleNotificationSubtitle ( diffSchedulesResult . rule ) ;
const obj10 = require ( 10221 ) /* _createForOfIteratorHelperLoose */ ;
obj1 . inAppNotificationId = require ( 10236 ) /* hasMedia */ . generateInAppNotificationId ( ) ;
2026-07-20 16:05:17 +00:00
obj . notification = obj1 ;
handleEnqueueNotification ( obj ) ;
2026-07-23 10:11:24 +00:00
const obj11 = require ( 10236 ) /* hasMedia */ ;
2026-07-20 16:05:17 +00:00
}
} else {
return false ;
}
} else {
return false ;
}
}
} ) ;
2026-07-23 10:11:24 +00:00
let result = require ( "_inherits" ) . fileFinishedImporting ( "stores/native/InAppNotificationStore.tsx" ) ;
2026-07-20 16:05:17 +00:00
export default tmp7 ;