2026-07-25 08:10:48 +00:00
// Module ID: 4115
2026-07-27 11:26:19 +00:00
// Function ID: 34038
2026-07-20 16:05:17 +00:00
// Name: _createForOfIteratorHelperLoose
2026-07-25 08:10:48 +00:00
// Dependencies: [4116, 653, 655, 4119, 1445, 4120, 4121, 7711, 4564, 4047, 7819, 4117, 5968, 8881, 8112, 5922, 4989, 2]
2026-07-20 16:05:17 +00:00
// Exports: findCodedLink, isSuspiciousCodedLink, remainingPathFromDiscordHostMatch
2026-07-25 08:10:48 +00:00
// Module 4115 (_createForOfIteratorHelperLoose)
2026-07-23 10:11:24 +00:00
import _isNativeReflectConstruct from "_isNativeReflectConstruct" ;
import { PRIMARY_DOMAIN } from "ME" ;
import { CollectibleShopTab } from "items" ;
import importDefaultResult from "set" ;
import importDefaultResult1 from "set" ;
import importDefaultResult2 from "set" ;
import importDefaultResult3 from "set" ;
import importDefaultResult4 from "set" ;
let require = arg1 ;
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 getHost ( GUILD_TEMPLATE_HOST ) {
if ( null == GUILD_TEMPLATE_HOST ) {
2026-07-23 10:11:24 +00:00
return { host : null , pathPrefix : null } ;
2026-07-20 16:05:17 +00:00
} else if ( GUILD_TEMPLATE_HOST . indexOf ( "/" ) >= 0 ) {
2026-07-23 10:11:24 +00:00
const parsed = require ( 1445 ) /* Url */ . parse ( GUILD_TEMPLATE_HOST , undefined , true ) ;
2026-07-20 16:05:17 +00:00
let obj = { } ;
( { host : obj3.host , pathname : obj3.pathPrefix } = parsed ) ;
return obj ;
} else {
obj = { host : GUILD_TEMPLATE_HOST , pathPrefix : null } ;
return obj ;
}
}
function isHostMatch ( host , host2 ) {
let replaced ;
if ( null != host2 . host ) {
replaced = str . replace ( /^www[.]/i , "" ) ;
}
return replaced === host . host ;
}
function remainingPathFromHostMatch ( closure_22 , pathname ) {
if ( isHostMatch ( closure_22 , pathname ) ) {
pathname = pathname . pathname ;
let str2 = "" ;
if ( null != pathname ) {
str2 = pathname ;
}
const pathPrefix = closure_22 . pathPrefix ;
let str3 = "" ;
if ( null != pathPrefix ) {
str3 = pathPrefix ;
}
if ( str2 . startsWith ( str3 ) ) {
const substr = str2 . substring ( str3 . length ) ;
let tmp2 = null ;
if ( "" !== substr ) {
tmp2 = substr ;
}
return tmp2 ;
} else {
return null ;
}
} else {
return null ;
}
}
function getPathsFromURL ( target ) {
const tmp = parseURLSafely ( target ) ;
if ( null != tmp ) {
if ( null != tmp . pathname ) {
let obj = { url : tmp , inviteHostRemainingPath : remainingPathFromHostMatch ( host , tmp ) , templateHostRemainingPath : remainingPathFromHostMatch ( host1 , tmp ) } ;
let tmp4 = remainingPathFromHostMatch ( host2 , tmp ) ;
if ( null == tmp4 ) {
tmp4 = remainingPathFromHostMatch ( closure_22 , tmp ) ;
}
if ( null == tmp4 ) {
tmp4 = remainingPathFromHostMatch ( closure_23 , tmp ) ;
}
if ( null == tmp4 ) {
tmp4 = remainingPathFromHostMatch ( host3 , tmp ) ;
}
if ( null == tmp4 ) {
tmp4 = remainingPathFromHostMatch ( host4 , tmp ) ;
}
obj . primaryHostRemainingPath = tmp4 ;
}
return obj ;
}
2026-07-23 10:11:24 +00:00
obj = { url : null , inviteHostRemainingPath : null , templateHostRemainingPath : null , primaryHostRemainingPath : null } ;
2026-07-20 16:05:17 +00:00
}
function findCodedLinks ( sanitizeUrlResult ) {
if ( null == sanitizeUrlResult ) {
return [ ] ;
} else {
const str = sanitizeUrlResult . replace ( regExp1 , ( arg0 , arg1 , arg2 , arg3 ) = > {
let combined = arg0 ;
if ( null == arg2 ) {
const _HermesInternal = HermesInternal ;
combined = "" + arg1 + "http://" + arg3 ;
}
return combined ;
} ) ;
2026-07-23 10:11:24 +00:00
let obj = { allowLinks : true } ;
2026-07-20 16:05:17 +00:00
let items = [ ] ;
2026-07-23 10:11:24 +00:00
let combined = items ;
2026-07-25 08:10:48 +00:00
const _default = combined ( 4121 ) . default ;
const parseToASTResult = combined ( 4121 ) . default . parseToAST ( str , true , obj ) ;
combined ( 7711 ) . walkAst ( parseToASTResult , ( type ) = > {
2026-07-23 10:11:24 +00:00
let tmp = type . type === combined ( outer1_1 [ 8 ] ) . AST_KEY . LINK ;
2026-07-20 16:05:17 +00:00
if ( tmp ) {
tmp = "string" === typeof type . target ;
}
if ( tmp ) {
tmp = type . target . length > 0 ;
}
if ( tmp ) {
combined . push ( type . target ) ;
}
} ) ;
2026-07-23 10:11:24 +00:00
let match = str . match ( closure_18 ) ;
2026-07-20 16:05:17 +00:00
if ( null == items ) {
items = [ ] ;
}
if ( null == match ) {
match = [ ] ;
}
2026-07-23 10:11:24 +00:00
combined = items . concat ( match ) ;
2026-07-25 08:10:48 +00:00
const obj2 = combined ( 7711 ) ;
2026-07-23 10:11:24 +00:00
return ( function coerceLinksToCodedLinks ( combined ) {
2026-07-20 16:05:17 +00:00
let done ;
if ( null != combined ) {
if ( 0 !== combined . length ) {
const _Set = Set ;
const set = new Set ( ) ;
const items = [ ] ;
function _loop ( value ) {
let applicationId ;
let inviteHostRemainingPath ;
let primaryHostRemainingPath ;
let skuId ;
let templateHostRemainingPath ;
let url ;
2026-07-23 10:11:24 +00:00
let closure_0 = value ;
2026-07-20 16:05:17 +00:00
function add ( INVITE , inviteKeyFromUrlParams ) {
2026-07-23 10:11:24 +00:00
if ( ! value . has ( inviteKeyFromUrlParams ) ) {
value . add ( inviteKeyFromUrlParams ) ;
const obj = { type : INVITE , code : inviteKeyFromUrlParams , url : value } ;
outer1_1 . push ( obj ) ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
let formatted = outer2_31 ( value ) ;
2026-07-20 16:05:17 +00:00
( { url , inviteHostRemainingPath , templateHostRemainingPath , primaryHostRemainingPath } = formatted ) ;
if ( null != url ) {
if ( null != url . pathname ) {
2026-07-23 10:11:24 +00:00
formatted = combined ;
formatted = outer2_1 ;
2026-07-20 16:05:17 +00:00
if ( obj9 . isBuildOverrideLink ( value ) ) {
2026-07-23 10:11:24 +00:00
add ( combined ( outer2_1 [ 5 ] ) . CodedLinkType . BUILD_OVERRIDE , value ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let obj = combined ( outer2_1 [ 9 ] ) ;
2026-07-20 16:05:17 +00:00
if ( obj . isManualBuildOverrideLink ( value ) ) {
2026-07-23 10:11:24 +00:00
add ( combined ( outer2_1 [ 5 ] ) . CodedLinkType . MANUAL_BUILD_OVERRIDE , value ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
obj9 = combined ( outer2_1 [ 9 ] ) ;
2026-07-20 16:05:17 +00:00
if ( obj2 . isExperimentEmbedURL ( value ) ) {
2026-07-23 10:11:24 +00:00
add ( combined ( outer2_1 [ 5 ] ) . CodedLinkType . EXPERIMENT , value ) ;
2026-07-20 16:05:17 +00:00
}
let match ;
if ( null != inviteHostRemainingPath ) {
2026-07-23 10:11:24 +00:00
match = inviteHostRemainingPath . match ( outer2_4 ) ;
2026-07-20 16:05:17 +00:00
}
if ( null != match ) {
if ( "https:" === url . protocol ) {
2026-07-23 10:11:24 +00:00
const inviteKeyFromUrlParams = combined ( outer2_1 [ 11 ] ) . generateInviteKeyFromUrlParams ( inviteHostRemainingPath . substring ( 1 ) , url . search ) ;
const invite = outer2_2 . getInvite ( inviteKeyFromUrlParams ) ;
2026-07-20 16:05:17 +00:00
if ( null != invite ) {
if ( obj4 . isEmbeddedApplicationInvite ( invite ) ) {
2026-07-23 10:11:24 +00:00
add ( combined ( outer2_1 [ 5 ] ) . CodedLinkType . EMBEDDED_ACTIVITY_INVITE , inviteKeyFromUrlParams ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
obj4 = combined ( outer2_1 [ 12 ] ) ;
2026-07-20 16:05:17 +00:00
}
if ( value . includes ( "\\" ) ) {
return 0 ;
} else {
2026-07-23 10:11:24 +00:00
add ( combined ( outer2_1 [ 5 ] ) . CodedLinkType . INVITE , inviteKeyFromUrlParams ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const obj3 = combined ( outer2_1 [ 11 ] ) ;
2026-07-20 16:05:17 +00:00
}
}
let match1 ;
if ( null != templateHostRemainingPath ) {
2026-07-23 10:11:24 +00:00
match1 = templateHostRemainingPath . match ( outer2_4 ) ;
2026-07-20 16:05:17 +00:00
}
if ( null != match1 ) {
2026-07-23 10:11:24 +00:00
add ( combined ( outer2_1 [ 5 ] ) . CodedLinkType . TEMPLATE , templateHostRemainingPath . substring ( 1 ) ) ;
2026-07-20 16:05:17 +00:00
}
let match2 ;
if ( null != primaryHostRemainingPath ) {
2026-07-23 10:11:24 +00:00
match2 = primaryHostRemainingPath . match ( outer2_6 ) ;
2026-07-20 16:05:17 +00:00
}
if ( null != match2 ) {
formatted = match2 [ 1 ] . toUpperCase ( ) ;
2026-07-23 10:11:24 +00:00
formatted = combined ;
formatted = outer2_1 ;
if ( formatted === combined ( outer2_1 [ 5 ] ) . CodedLinkType . INVITE ) {
2026-07-20 16:05:17 +00:00
if ( value . includes ( "\\" ) ) {
return 0 ;
} else {
2026-07-23 10:11:24 +00:00
const inviteKeyFromUrlParams1 = combined ( outer2_1 [ 11 ] ) . generateInviteKeyFromUrlParams ( match2 [ 2 ] , url . search ) ;
add ( combined ( outer2_1 [ 5 ] ) . CodedLinkType . INVITE , inviteKeyFromUrlParams1 ) ;
const obj5 = combined ( outer2_1 [ 11 ] ) ;
2026-07-20 16:05:17 +00:00
}
} else {
add ( formatted , match2 [ 2 ] ) ;
}
const str24 = match2 [ 1 ] ;
}
let match3 ;
if ( null != primaryHostRemainingPath ) {
2026-07-23 10:11:24 +00:00
match3 = primaryHostRemainingPath . match ( outer2_5 ) ;
2026-07-20 16:05:17 +00:00
}
if ( null != match3 ) {
2026-07-23 10:11:24 +00:00
add ( combined ( outer2_1 [ 5 ] ) . CodedLinkType . CHANNEL_LINK , primaryHostRemainingPath . replace ( "/channels/" , "" ) ) ;
2026-07-20 16:05:17 +00:00
}
let tmp47 = null ;
if ( null != url . pathname ) {
2026-07-23 10:11:24 +00:00
const match4 = str6 . match ( outer2_7 ) ;
2026-07-20 16:05:17 +00:00
let tmp49 = null ;
if ( null != match4 ) {
tmp49 = null ;
if ( match4 . length >= 4 ) {
obj = { guildId : match4 [ 1 ] , guildEventId : match4 [ 2 ] , recurrenceId : match4 [ 4 ] } ;
tmp49 = obj ;
}
}
tmp47 = tmp49 ;
}
if ( null != tmp47 ) {
const _HermesInternal = HermesInternal ;
let str7 = "" ;
2026-07-23 10:11:24 +00:00
combined = "" + tmp47 . guildId + "-" + tmp47 . guildEventId ;
2026-07-20 16:05:17 +00:00
if ( null != tmp47 . recurrenceId ) {
const _HermesInternal2 = HermesInternal ;
str7 = "-" + tmp47 . recurrenceId ;
}
2026-07-23 10:11:24 +00:00
add ( combined ( outer2_1 [ 5 ] ) . CodedLinkType . EVENT , combined + str7 ) ;
2026-07-20 16:05:17 +00:00
}
let match5 ;
if ( null != primaryHostRemainingPath ) {
2026-07-23 10:11:24 +00:00
match5 = primaryHostRemainingPath . match ( outer2_16 ) ;
2026-07-20 16:05:17 +00:00
}
if ( null != match5 ) {
if ( null != url . query ) {
2026-07-23 10:11:24 +00:00
formatted = combined ;
formatted = outer2_1 ;
formatted = combined ( outer2_1 [ 13 ] ) . parseOAuth2AuthorizeProps ( url . query ) ;
2026-07-20 16:05:17 +00:00
const clientId = formatted . clientId ;
let tmp57 = null == clientId ;
if ( ! tmp57 ) {
tmp57 = "" === clientId ;
}
if ( ! tmp57 ) {
const scopes = formatted . scopes ;
2026-07-23 10:11:24 +00:00
tmp57 = null != scopes && scopes . some ( ( arg0 ) = > arg0 !== combined ( outer3_1 [ 14 ] ) . OAuth2Scopes . APPLICATIONS_COMMANDS ) ;
const tmp58 = null != scopes && scopes . some ( ( arg0 ) = > arg0 !== combined ( outer3_1 [ 14 ] ) . OAuth2Scopes . APPLICATIONS_COMMANDS ) ;
2026-07-20 16:05:17 +00:00
}
if ( ! tmp57 ) {
2026-07-23 10:11:24 +00:00
add ( combined ( outer2_1 [ 5 ] ) . CodedLinkType . APP_OAUTH2_LINK , clientId ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const obj10 = combined ( outer2_1 [ 13 ] ) ;
2026-07-20 16:05:17 +00:00
}
}
let match6 ;
if ( null != primaryHostRemainingPath ) {
2026-07-23 10:11:24 +00:00
match6 = primaryHostRemainingPath . match ( outer2_8 ) ;
2026-07-20 16:05:17 +00:00
}
if ( null != match6 ) {
2026-07-23 10:11:24 +00:00
add ( combined ( outer2_1 [ 5 ] ) . CodedLinkType . APP_DIRECTORY_PROFILE , match6 [ 2 ] ) ;
2026-07-20 16:05:17 +00:00
}
let match7 ;
if ( null != primaryHostRemainingPath ) {
2026-07-23 10:11:24 +00:00
match7 = primaryHostRemainingPath . match ( outer2_9 ) ;
2026-07-20 16:05:17 +00:00
}
if ( null != match7 ) {
if ( null != match7 [ 3 ] ) {
2026-07-23 10:11:24 +00:00
const storefrontSKUCodedLink = combined ( outer2_1 [ 15 ] ) . makeStorefrontSKUCodedLink ( tmp69 , tmp70 ) ;
add ( combined ( outer2_1 [ 5 ] ) . CodedLinkType . APP_DIRECTORY_STOREFRONT_SKU , storefrontSKUCodedLink ) ;
const obj7 = combined ( outer2_1 [ 15 ] ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
add ( combined ( outer2_1 [ 5 ] ) . CodedLinkType . APP_DIRECTORY_STOREFRONT , tmp69 ) ;
2026-07-20 16:05:17 +00:00
}
}
let match8 ;
if ( null != primaryHostRemainingPath ) {
2026-07-23 10:11:24 +00:00
match8 = primaryHostRemainingPath . match ( outer2_10 ) ;
2026-07-20 16:05:17 +00:00
}
if ( null != match8 ) {
2026-07-23 10:11:24 +00:00
add ( combined ( outer2_1 [ 5 ] ) . CodedLinkType . ACTIVITY_BOOKMARK , match8 [ 1 ] ) ;
2026-07-20 16:05:17 +00:00
}
let match9 ;
if ( null != primaryHostRemainingPath ) {
2026-07-23 10:11:24 +00:00
match9 = primaryHostRemainingPath . match ( outer2_11 ) ;
2026-07-20 16:05:17 +00:00
}
if ( null != match9 ) {
const _HermesInternal3 = HermesInternal ;
2026-07-23 10:11:24 +00:00
add ( combined ( outer2_1 [ 5 ] ) . CodedLinkType . GUILD_PRODUCT , "" + match9 [ 1 ] + "-" + match9 [ 2 ] ) ;
2026-07-20 16:05:17 +00:00
}
let match10 ;
if ( null != primaryHostRemainingPath ) {
2026-07-23 10:11:24 +00:00
match10 = primaryHostRemainingPath . match ( outer2_13 ) ;
2026-07-20 16:05:17 +00:00
}
if ( null != match10 ) {
2026-07-23 10:11:24 +00:00
add ( combined ( outer2_1 [ 5 ] ) . CodedLinkType . SERVER_SHOP , match10 [ 1 ] ) ;
2026-07-20 16:05:17 +00:00
}
let match11 ;
if ( null != primaryHostRemainingPath ) {
2026-07-23 10:11:24 +00:00
match11 = primaryHostRemainingPath . match ( outer2_12 ) ;
2026-07-20 16:05:17 +00:00
}
if ( null != match11 ) {
let tmp98 = match11 [ 1 ] ;
if ( null == tmp98 ) {
tmp98 = match11 [ 2 ] ;
}
const _HermesInternal4 = HermesInternal ;
2026-07-23 10:11:24 +00:00
formatted = add ( combined ( outer2_1 [ 5 ] ) . CodedLinkType . SOCIAL_LAYER_STOREFRONT , "" + match11 [ 3 ] + "-" + tmp98 ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
formatted = outer2_33 ;
formatted = outer2_33 ( value ) ;
2026-07-20 16:05:17 +00:00
if ( null != formatted ) {
2026-07-23 10:11:24 +00:00
formatted = combined ;
formatted = outer2_1 ;
formatted = add ( combined ( outer2_1 [ 5 ] ) . CodedLinkType . QUESTS_EMBED , formatted ) ;
2026-07-20 16:05:17 +00:00
}
formatted = undefined ;
if ( null != primaryHostRemainingPath ) {
2026-07-23 10:11:24 +00:00
formatted = outer2_15 ;
formatted = primaryHostRemainingPath . match ( outer2_15 ) ;
2026-07-20 16:05:17 +00:00
}
if ( null != formatted ) {
2026-07-23 10:11:24 +00:00
formatted = combined ;
formatted = outer2_1 ;
formatted = add ( combined ( outer2_1 [ 5 ] ) . CodedLinkType . GAME_PROFILE , formatted [ 1 ] ) ;
2026-07-20 16:05:17 +00:00
}
if ( "/shop" === primaryHostRemainingPath ) {
formatted = null ;
if ( null != url . query ) {
2026-07-23 10:11:24 +00:00
formatted = combined ;
formatted = outer2_1 ;
formatted = combined ( outer2_1 [ 16 ] ) . parse ( url . query ) ;
const obj8 = combined ( outer2_1 [ 16 ] ) ;
2026-07-20 16:05:17 +00:00
}
formatted = undefined ;
if ( null != formatted ) {
formatted = formatted . tab ;
}
2026-07-23 10:11:24 +00:00
formatted = outer2_3 ;
if ( formatted === outer2_3 . GAME_SHOPS ) {
2026-07-20 16:05:17 +00:00
formatted = undefined ;
if ( null != formatted ) {
formatted = formatted . applicationId ;
}
if ( null != formatted ) {
formatted = undefined ;
if ( null != formatted ) {
formatted = formatted . skuId ;
}
if ( null != formatted ) {
( { applicationId , skuId } = formatted ) ;
formatted = "string" === typeof applicationId && "string" === typeof skuId ;
if ( formatted ) {
2026-07-23 10:11:24 +00:00
formatted = combined ;
formatted = outer2_1 ;
2026-07-20 16:05:17 +00:00
formatted = globalThis ;
const _HermesInternal6 = HermesInternal ;
2026-07-23 10:11:24 +00:00
formatted = add ( combined ( outer2_1 [ 5 ] ) . CodedLinkType . SOCIAL_LAYER_STOREFRONT_APP , "" + skuId + "-" + applicationId ) ;
2026-07-20 16:05:17 +00:00
}
}
}
}
formatted = undefined ;
if ( null != url . hash ) {
2026-07-23 10:11:24 +00:00
formatted = outer2_17 ;
formatted = str15 . match ( outer2_17 ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
formatted = combined ;
formatted = outer2_1 ;
2026-07-20 16:05:17 +00:00
let str17 = "" ;
if ( null != formatted ) {
str17 = formatted ;
}
formatted = undefined ;
if ( null != formatted ) {
formatted = formatted [ 1 ] ;
}
let str18 = "" ;
if ( null != formatted ) {
str18 = formatted ;
}
formatted = globalThis ;
const _HermesInternal5 = HermesInternal ;
2026-07-23 10:11:24 +00:00
formatted = add ( combined ( outer2_1 [ 5 ] ) . CodedLinkType . COLLECTIBLES_SHOP , "" + str17 + "-" + str18 ) ;
2026-07-20 16:05:17 +00:00
}
}
}
return 0 ;
}
2026-07-23 10:11:24 +00:00
const tmp7 = outer1_27 ( combined ) ;
2026-07-20 16:05:17 +00:00
let iter = tmp7 ( ) ;
if ( ! iter . done ) {
do {
let _loopResult = _loop ( iter . value ) ;
let iter2 = tmp7 ( ) ;
iter = iter2 ;
done = iter2 . done ;
} while ( ! done ) ;
}
return items ;
}
}
return [ ] ;
2026-07-23 10:11:24 +00:00
} ) ( combined ) . slice ( 0 , 10 ) ;
2026-07-20 16:05:17 +00:00
}
}
function parseQuestsEmbedCode ( target ) {
const tmp = getPathsFromURL ( target ) ;
let match ;
if ( null != tmp ) {
if ( null != tmp . primaryHostRemainingPath ) {
match = str . match ( closure_14 ) ;
}
}
let tmp4 ;
if ( null != match ) {
tmp4 = match [ 1 ] ;
}
let tmp5 = null ;
if ( null != tmp4 ) {
tmp5 = tmp4 ;
}
return tmp5 ;
}
function parseURLSafely ( url ) {
2026-07-23 10:11:24 +00:00
return require ( 1445 ) /* Url */ . parse ( url ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const re4 = /^\/([a-zA-Z0-9-]+)$/ ;
const re5 = /^\/channels\/([0-9]+|@me)\/([0-9]+)$/ ;
const re6 = /^\/(invite|template)\/([a-zA-Z0-9-]+)\/?\.?$/ ;
2026-07-20 16:05:17 +00:00
const regExp = new RegExp ( "^/events/(\\d+)(?:/)(\\d+)?((?:/)(\\d+))?" ) ;
2026-07-23 10:11:24 +00:00
const re8 = /^\/(application-directory|discovery\/applications)\/([0-9-]+)\/?((about|images|privacy)\/?)?$/ ;
const re9 = /^\/(application-directory|discovery\/applications)\/([0-9-]+)\/store\/?([0-9-]+)?\/?$/ ;
const re10 = /^\/activities\/([0-9-]+)\/?$/ ;
const re11 = /^\/channels\/([0-9]+)\/shop\/([0-9]+)$/ ;
const re12 = /^(?:\/game-shop\/([0-9]+)|\/channels\/([0-9]+)\/game-shop\/(?:[0-9]+))\/([0-9]+)(?:\/([^\/]+))?$/ ;
const re13 = /^\/channels\/([0-9]+)\/shop$/ ;
const re14 = /^\/quests\/([0-9-]+)\/?$/ ;
const re15 = /^\/games\/([0-9]+)(?:\/[A-Za-z0-9-]*)?\/?$/ ;
const re16 = /^\/oauth2\/authorize/ ;
const re17 = /^#itemSkuId=([0-9]+)$/ ;
let tmp3 = /dev:\/\/[\w-.~:\/?#\[\]@!$&'()*+,;=%]+/i ;
let closure_18 = tmp3 ;
2026-07-20 16:05:17 +00:00
let host = getHost ( window . GLOBAL_ENV . INVITE_HOST ) ;
const host1 = getHost ( window . GLOBAL_ENV . GUILD_TEMPLATE_HOST ) ;
if ( null == WEBAPP_ENDPOINT ) {
2026-07-23 10:11:24 +00:00
let _HermesInternal = HermesInternal ;
2026-07-20 16:05:17 +00:00
WEBAPP_ENDPOINT = "//canary." + PRIMARY_DOMAIN ;
}
let host2 = getHost ( WEBAPP_ENDPOINT ) ;
let closure_22 = getHost ( "//canary." + PRIMARY_DOMAIN ) ;
let closure_23 = getHost ( "//ptb." + PRIMARY_DOMAIN ) ;
let host3 = getHost ( "discordapp.com" ) ;
let host4 = getHost ( "discord.com" ) ;
host = host . host ;
let str2 = "" ;
let str3 = "" ;
if ( null != host ) {
str3 = host ;
}
2026-07-23 10:11:24 +00:00
let items = [ require ( "set" ) . escape ( str3 ) , , , , ] ;
2026-07-20 16:05:17 +00:00
host2 = host1 . host ;
let tmp9 = str2 ;
if ( null != host2 ) {
tmp9 = host2 ;
}
2026-07-23 10:11:24 +00:00
items [ 1 ] = require ( "set" ) . escape ( tmp9 ) ;
2026-07-20 16:05:17 +00:00
host3 = host2 . host ;
let tmp10 = str2 ;
if ( null != host3 ) {
tmp10 = host3 ;
}
2026-07-23 10:11:24 +00:00
items [ 2 ] = require ( "set" ) . escape ( tmp10 ) ;
2026-07-20 16:05:17 +00:00
host4 = host3 . host ;
let tmp11 = str2 ;
if ( null != host4 ) {
tmp11 = host4 ;
}
2026-07-23 10:11:24 +00:00
items [ 3 ] = require ( "set" ) . escape ( tmp11 ) ;
2026-07-20 16:05:17 +00:00
const host5 = host4 . host ;
if ( null != host5 ) {
str2 = host5 ;
}
2026-07-23 10:11:24 +00:00
items [ 4 ] = require ( "set" ) . escape ( str2 ) ;
2026-07-20 16:05:17 +00:00
const found = items . filter ( Boolean ) ;
const regExp1 = new RegExp ( "((https?://[^ ]*)|^|\\s)(" + found . join ( "|" ) + ")" , "g" ) ;
2026-07-23 10:11:24 +00:00
const result = require ( "items" ) . fileFinishedImporting ( "modules/coded_links/findCodedLinks.tsx" ) ;
2026-07-20 16:05:17 +00:00
export default findCodedLinks ;
export const DEVLINK_REGEX = tmp3 ;
export const remainingPathFromDiscordHostMatch = function remainingPathFromDiscordHostMatch ( parseURLSafelyResult ) {
let tmp = remainingPathFromHostMatch ( host2 , parseURLSafelyResult ) ;
if ( null == tmp ) {
tmp = remainingPathFromHostMatch ( closure_22 , parseURLSafelyResult ) ;
}
if ( null == tmp ) {
tmp = remainingPathFromHostMatch ( closure_23 , parseURLSafelyResult ) ;
}
if ( null == tmp ) {
tmp = remainingPathFromHostMatch ( host3 , parseURLSafelyResult ) ;
}
if ( null == tmp ) {
tmp = remainingPathFromHostMatch ( host4 , parseURLSafelyResult ) ;
}
return tmp ;
} ;
export { getPathsFromURL } ;
export const isSuspiciousCodedLink = function isSuspiciousCodedLink ( arr ) {
if ( arr . includes ( "\\" ) ) {
const tmp2 = parseURLSafely ( arr ) ;
2026-07-23 10:11:24 +00:00
const require = tmp2 ;
2026-07-20 16:05:17 +00:00
if ( null == tmp2 ) {
return false ;
} else if ( isHostMatch ( host , tmp2 ) ) {
return true ;
} else {
const items = [ host2 , closure_22 , closure_23 , host3 , host4 ] ;
2026-07-23 10:11:24 +00:00
if ( items . some ( ( arg0 ) = > outer1_29 ( arg0 , closure_0 ) ) ) {
2026-07-20 16:05:17 +00:00
let hasItem ;
if ( null != tmp2 . pathname ) {
const formatted = str . toUpperCase ( ) ;
2026-07-25 08:10:48 +00:00
hasItem = formatted . includes ( require ( 4120 ) /* CodedLinkType */ . CodedLinkType . INVITE ) ;
2026-07-20 16:05:17 +00:00
}
return null != hasItem && hasItem ;
}
}
}
return false ;
} ;
export { parseQuestsEmbedCode } ;
export { parseURLSafely } ;
export const findCodedLink = function findCodedLink ( sanitizeUrlResult ) {
return findCodedLinks ( sanitizeUrlResult ) [ 0 ] ;
} ;