2026-07-21 06:55:02 +00:00
// Module ID: 8334
// Function ID: 66028
2026-07-20 16:05:17 +00:00
// Name: _createForOfIteratorHelperLoose
// Dependencies: []
2026-07-21 06:55:02 +00:00
// Module 8334 (_createForOfIteratorHelperLoose)
2026-07-20 16:05:17 +00:00
function _createForOfIteratorHelperLoose ( @ @iterator ) {
let require = Symbol_iterator ;
@ @iterator = "undefined" !== typeof Symbol ;
if ( Symbol_iterator ) {
const _Symbol = Symbol ;
@ @iterator = Symbol_iterator [ Symbol . iterator ] ;
}
if ( ! Symbol_iterator ) {
@ @iterator = Symbol_iterator [ Symbol . iterator ] ;
}
if ( Symbol_iterator ) {
const iter = Symbol_iterator . call ( Symbol_iterator ) ;
const next = iter . next ;
return next . bind ( iter ) ;
} else {
const _Array = Array ;
let tmp = Symbol_iterator ;
if ( ! Array . isArray ( Symbol_iterator ) ) {
let tmp2 ;
if ( Symbol_iterator ) {
if ( "string" === typeof Symbol_iterator ) {
tmp2 = _arrayLikeToArray ( Symbol_iterator , undefined ) ;
} else {
const toString = { } . toString ;
const substr = toString . call ( Symbol_iterator ) . slice ( 8 , - 1 ) ;
let name = substr ;
if ( tmp3 ) {
name = Symbol_iterator . constructor . name ;
}
if ( "Map" !== name ) {
if ( "Set" !== name ) {
if ( "Arguments" === name ) {
let arr = _arrayLikeToArray ( Symbol_iterator , undefined ) ;
} else {
const obj = /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/ ;
}
}
tmp2 = arr ;
}
const _Array2 = Array ;
arr = Array . from ( Symbol_iterator ) ;
const callResult = toString . call ( Symbol_iterator ) ;
const tmp3 = "Object" === substr && Symbol_iterator . constructor ;
}
}
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 ) {
require = tmp ;
}
let closure_1 = 0 ;
return ( ) = > {
if ( closure_1 >= tmp . length ) {
let obj = { done : true } ;
} else {
obj = { done : false } ;
closure_1 = tmp3 + 1 ;
obj . value = tmp [ + closure_1 ] ;
}
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 ) ;
}
}
const AnalyticEvents = require ( dependencyMap [ 0 ] ) . AnalyticEvents ;
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 ) = > {
let obj = importDefault ( dependencyMap [ 2 ] ) ;
const safeParseWithQueryResult = obj . safeParseWithQuery ( aPIEndpoint ) ;
if ( null == safeParseWithQueryResult ) {
return null ;
} else {
const tryParseChannelPathResult = require ( dependencyMap [ 3 ] ) . tryParseChannelPath ( safeParseWithQueryResult . path ) ;
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 ;
}
] ;
const _module = require ( dependencyMap [ 5 ] ) ;
const result = _module . fileFinishedImporting ( "modules/links/LinkAnalyticsUtils.tsx" ) ;
export default {
trackDiscordLinkClicked ( guildId ) {
let obj = importDefault ( dependencyMap [ 4 ] ) ;
obj = { is_discord_link : true , discord_link_type : getDiscordLinkTypeFromMetadata ( guildId ) } ;
obj . track ( AnalyticEvents . LINK_CLICKED , obj ) ;
} ,
trackLinkClicked ( ctaLink , guildId ) {
if ( null != ctaLink ) {
let obj = importDefault ( dependencyMap [ 2 ] ) ;
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 ;
importDefault ( dependencyMap [ 4 ] ) . track ( AnalyticEvents . LINK_CLICKED , obj ) ;
const obj2 = importDefault ( dependencyMap [ 4 ] ) ;
}
} ,
trackAnnouncementMessageLinkClicked ( arg0 ) {
let channelId ;
let guildId ;
let messageId ;
let sourceChannelId ;
let sourceGuildId ;
( { messageId , channelId , guildId , sourceChannelId , sourceGuildId } = arg0 ) ;
importDefault ( dependencyMap [ 4 ] ) . track ( AnalyticEvents . ANNOUNCEMENT_MESSAGE_LINK_CLICKED , { message_id : messageId , channel_id : channelId , guild_id : guildId , source_channel_id : sourceChannelId , source_guild_id : sourceGuildId } ) ;
}
} ;