2026-07-23 10:11:24 +00:00
// Module ID: 8341
// Function ID: 66088
2026-07-20 16:05:17 +00:00
// Name: _createForOfIteratorHelperLoose
2026-07-23 10:11:24 +00:00
// Dependencies: [653, 8342, 1443, 4321, 675, 2]
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
// Module 8341 (_createForOfIteratorHelperLoose)
import { AnalyticEvents } from "ME" ;
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 getDiscordLinkTypeFromMetadata ( guildId ) {
if ( null != guildId . guildId ) {
if ( null != guildId . channelId ) {
if ( null != guildId . messageId ) {
let UNKNOWN = constants . MESSAGE ;
}
return UNKNOWN ;
}
}
if ( null != guildId . guildId ) {
if ( null != guildId . channelId ) {
UNKNOWN = constants . CHANNEL ;
}
}
UNKNOWN = constants . UNKNOWN ;
}
function getDiscordLinkType ( ctaLink , guildId ) {
if ( null == guildId ) {
if ( null == ctaLink ) {
let UNKNOWN = constants . UNKNOWN ;
}
return UNKNOWN ;
}
if ( null == guildId ) {
const tmp4 = _createForOfIteratorHelperLoose ( items ) ;
const iter = tmp4 ( ) ;
let iter2 = iter ;
if ( iter . done ) {
let UNKNOWN2 = constants . UNKNOWN ;
} else {
UNKNOWN2 = iter2 . value ( ctaLink ) ;
while ( null == UNKNOWN2 ) {
let iter3 = tmp4 ( ) ;
iter2 = iter3 ;
break ;
}
}
UNKNOWN = UNKNOWN2 ;
} else {
UNKNOWN = getDiscordLinkTypeFromMetadata ( guildId ) ;
}
}
let closure_4 = { MESSAGE : "Discord Message Link" , CHANNEL : "Discord Channel Link" , SERVER_INVITE : "Discord Server Invite" , GIFT : "Discord Gift Link" , UNKNOWN : "Unknown" , DISCOVERY : "Discord Discovery Link" } ;
const items = [
( arr ) = > {
let SERVER_INVITE = null ;
if ( obj . isInvite ( arr ) ) {
SERVER_INVITE = constants . SERVER_INVITE ;
}
return SERVER_INVITE ;
} ,
( aPIEndpoint ) = > {
2026-07-23 10:11:24 +00:00
let obj = importDefault ( 1443 ) ;
2026-07-20 16:05:17 +00:00
const safeParseWithQueryResult = obj . safeParseWithQuery ( aPIEndpoint ) ;
if ( null == safeParseWithQueryResult ) {
return null ;
} else {
2026-07-23 10:11:24 +00:00
const tryParseChannelPathResult = require ( 4321 ) /* canViewChannel */ . tryParseChannelPath ( safeParseWithQueryResult . path ) ;
2026-07-20 16:05:17 +00:00
let tmp5 = null ;
if ( null != tryParseChannelPathResult ) {
obj = { } ;
( { guildId : obj3.guildId , channelId : obj3.channelId , messageId : obj3.messageId } = tryParseChannelPathResult ) ;
tmp5 = getDiscordLinkTypeFromMetadata ( obj ) ;
}
return tmp5 ;
}
} ,
( arg0 ) = > {
let DISCOVERY = null ;
if ( obj . isDiscoveryLink ( arg0 ) ) {
DISCOVERY = constants . DISCOVERY ;
}
return DISCOVERY ;
}
] ;
2026-07-23 10:11:24 +00:00
const result = require ( "isOriginalContentTypeDifferent" ) . fileFinishedImporting ( "modules/links/LinkAnalyticsUtils.tsx" ) ;
2026-07-20 16:05:17 +00:00
export default {
trackDiscordLinkClicked ( guildId ) {
2026-07-23 10:11:24 +00:00
let obj = importDefault ( 675 ) ;
2026-07-20 16:05:17 +00:00
obj = { is_discord_link : true , discord_link_type : getDiscordLinkTypeFromMetadata ( guildId ) } ;
obj . track ( AnalyticEvents . LINK_CLICKED , obj ) ;
} ,
trackLinkClicked ( ctaLink , guildId ) {
if ( null != ctaLink ) {
2026-07-23 10:11:24 +00:00
let obj = importDefault ( 1443 ) ;
2026-07-20 16:05:17 +00:00
const tmp3 = obj . isDiscordUrl ( ctaLink , true ) || null != guildId ;
obj = { is_discord_link : tmp3 } ;
let tmp7 = null ;
if ( tmp3 ) {
tmp7 = getDiscordLinkType ( ctaLink , guildId ) ;
}
obj . discord_link_type = tmp7 ;
2026-07-23 10:11:24 +00:00
importDefault ( 675 ) . track ( AnalyticEvents . LINK_CLICKED , obj ) ;
const obj2 = importDefault ( 675 ) ;
2026-07-20 16:05:17 +00:00
}
} ,
trackAnnouncementMessageLinkClicked ( arg0 ) {
let channelId ;
let guildId ;
let messageId ;
let sourceChannelId ;
let sourceGuildId ;
( { messageId , channelId , guildId , sourceChannelId , sourceGuildId } = arg0 ) ;
2026-07-23 10:11:24 +00:00
importDefault ( 675 ) . track ( AnalyticEvents . ANNOUNCEMENT_MESSAGE_LINK_CLICKED , { message_id : messageId , channel_id : channelId , guild_id : guildId , source_channel_id : sourceChannelId , source_guild_id : sourceGuildId } ) ;
2026-07-20 16:05:17 +00:00
}
} ;