2026-07-23 10:11:24 +00:00
// Module ID: 5059
2026-07-24 07:16:23 +00:00
// Function ID: 43832
2026-07-20 16:05:17 +00:00
// Name: _createForOfIteratorHelperLoose
2026-07-23 10:11:24 +00:00
// Dependencies: [57, 29, 653, 636, 1212, 1832, 2]
2026-07-20 16:05:17 +00:00
// Exports: clientPromptToServerPrompt, getEmptyPrompt, isDefaultPrompt, isEmojiEmpty, parseConnectionIdentifier, serverApiResponseToClientState, validateOnboardingConnections
2026-07-23 10:11:24 +00:00
// Module 5059 (_createForOfIteratorHelperLoose)
import _slicedToArray from "_slicedToArray" ;
import _objectWithoutProperties from "_objectWithoutProperties" ;
import { PlatformTypes } from "ME" ;
import set from "ME" ;
const 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 getDefaultPrompt() {
2026-07-23 10:11:24 +00:00
const obj = { id : String ( Date . now ( ) ) , title : null , options : null , singleSelect : false , required : false , inOnboarding : true } ;
const intl = require ( 1212 ) /* getSystemLocale */ . intl ;
obj . title = intl . string ( require ( 1212 ) /* getSystemLocale */ . t . vY91C9 ) ;
2026-07-20 16:05:17 +00:00
obj . options = [ ] ;
obj . type = obj . MULTIPLE_CHOICE ;
return obj ;
}
function serverPromptToClientPrompt ( id ) {
const options = id . options ;
return {
id : id.id ,
options : options.map ( ( id ) = > {
const obj = { id : id.id , channelIds : id.channel_ids , roleIds : id.role_ids , emoji : id.emoji , title : id.title } ;
const description = id . description ;
let str = "" ;
if ( null != description ) {
str = description ;
}
obj . description = str ;
return obj ;
} ) ,
title : id.title ,
singleSelect : id.single_select ,
disabled : id.disabled ,
required : id.required ,
inOnboarding : id.in_onboarding ,
type : id . type
} ;
}
function getConnectionIdentifier ( connection_type ) {
if ( connection_type . connection_type === obj . APPLICATION ) {
const _HermesInternal2 = HermesInternal ;
let combined = "app:" + connection_type . application_id ;
} else {
const _HermesInternal = HermesInternal ;
combined = "provider:" + connection_type . provider_id ;
}
return combined ;
}
function validateOnboardingConnection ( connection_type ) {
const items = [ ] ;
connection_type = connection_type . connection_type ;
if ( obj . APPLICATION === connection_type ) {
if ( obj3 . isNullOrEmpty ( connection_type . application_id ) ) {
items . push ( "Application ID is required for application connections" ) ;
}
2026-07-23 10:11:24 +00:00
obj3 = require ( 1832 ) /* isNullOrEmpty */ ;
2026-07-20 16:05:17 +00:00
if ( ! obj4 . isNullOrEmpty ( connection_type . provider_id ) ) {
items . push ( "Platform ID not allowed for application connections" ) ;
}
2026-07-23 10:11:24 +00:00
obj4 = require ( 1832 ) /* isNullOrEmpty */ ;
2026-07-20 16:05:17 +00:00
} else if ( obj . PROVIDER_CONNECTED_ACCOUNT === connection_type ) {
2026-07-23 10:11:24 +00:00
obj = require ( 1832 ) /* isNullOrEmpty */ ;
2026-07-20 16:05:17 +00:00
if ( obj . isNullOrEmpty ( connection_type . provider_id ) ) {
items . push ( "Platform ID is required for platform connections" ) ;
} else if ( ! closure_10 . includes ( connection_type . provider_id ) ) {
items . push ( "Invalid platform ID" ) ;
}
if ( ! obj2 . isNullOrEmpty ( connection_type . application_id ) ) {
items . push ( "Application ID not allowed for platform connections" ) ;
}
2026-07-23 10:11:24 +00:00
obj2 = require ( 1832 ) /* isNullOrEmpty */ ;
2026-07-20 16:05:17 +00:00
} else {
const connection_type2 = connection_type . connection_type ;
items . push ( "Invalid connection type" ) ;
return items ;
}
let tmp16 = null != connection_type . description ;
if ( tmp16 ) {
tmp16 = connection_type . description . length > 100 ;
}
if ( tmp16 ) {
items . push ( "Description must be 100 characters or less" ) ;
}
return items ;
}
2026-07-23 10:11:24 +00:00
let closure_3 = [ "id" ] ;
let closure_4 = [ "id" ] ;
2026-07-20 16:05:17 +00:00
let obj = { MULTIPLE_CHOICE : 0 , [ 0 ] : "MULTIPLE_CHOICE" , DROPDOWN : 1 , [ 1 ] : "DROPDOWN" } ;
obj = { APPLICATION : 0 , [ 0 ] : "APPLICATION" , PROVIDER_CONNECTED_ACCOUNT : 1 , [ 1 ] : "PROVIDER_CONNECTED_ACCOUNT" } ;
2026-07-23 10:11:24 +00:00
let items = [ , , , , , , , ] ;
2026-07-20 16:05:17 +00:00
( { PLAYSTATION_STAGING : arr [ 0 ] , CONTACTS : arr [ 1 ] , DOMAIN : arr [ 2 ] , TWITTER_LEGACY : arr [ 3 ] , MASTODON : arr [ 4 ] , INSTAGRAM : arr [ 5 ] , LEAGUE_OF_LEGENDS : arr [ 6 ] , SKYPE : arr [ 7 ] } = PlatformTypes ) ;
2026-07-23 10:11:24 +00:00
let set = new Set ( items ) ;
2026-07-20 16:05:17 +00:00
const values = Object . values ( PlatformTypes ) ;
let closure_10 = values . filter ( ( arg0 ) = > ! set . has ( arg0 ) ) ;
2026-07-23 10:11:24 +00:00
const result = set . fileFinishedImporting ( "modules/guild_onboarding/GuildOnboardingPromptsConstants.tsx" ) ;
2026-07-20 16:05:17 +00:00
export const MAX_PROMPT_TITLE_LENGTH = 100 ;
export const MAX_PROMPT_OPTION_TITLE_LENGTH = 50 ;
export const MAX_PROMPT_OPTION_DESCRIPTION_LENGTH = 100 ;
export const MAX_NUM_PROMPTS = 15 ;
export const MULTIPLE_CHOICE_MAX_NUM_OPTIONS = 12 ;
export const DROPDOWN_MAX_NUM_OPTIONS = 50 ;
export const MAX_DEFAULT_CHANNEL_IDS = 25 ;
export const MAX_NUMBER_OF_ONBOARDING_CONNECTIONS = 10 ;
export const MAX_CONNECTION_DESCRIPTION_LENGTH = 100 ;
export const MAX_NUMBER_OF_ONBOARDING_PROMPTS_IN_ONBOARDING = 4 ;
export const NUM_DEFAULT_CHATTABLE_CHANNELS_MIN = 1 ;
export const ONBOARDING_PROMPT_TYPE_SWITCH_THRESHOLD = 13 ;
export const GuildOnboardingTab = { CUSTOMIZE : 0 , [ 0 ] : "CUSTOMIZE" , BROWSE : 1 , [ 1 ] : "BROWSE" } ;
export const OnboardingPromptType = obj ;
export const GuildOnboardingMode = { ONBOARDING_DEFAULT : 0 , [ 0 ] : "ONBOARDING_DEFAULT" , ONBOARDING_ADVANCED : 1 , [ 1 ] : "ONBOARDING_ADVANCED" } ;
export const OnboardingConnectionType = obj ;
export const isDefaultPrompt = function isDefaultPrompt ( options ) {
if ( options . options . length > 0 ) {
return false ;
} else {
const tmp2 = getDefaultPrompt ( ) ;
const id = tmp2 . id ;
const id2 = options . id ;
const tmp5 = callback2 ( tmp2 , closure_3 ) ;
2026-07-23 10:11:24 +00:00
return importDefault ( 636 ) ( tmp5 , callback2 ( options , closure_4 ) ) ;
2026-07-20 16:05:17 +00:00
}
} ;
export { getDefaultPrompt } ;
export const getEmptyPrompt = function getEmptyPrompt ( inOnboarding ) {
2026-07-23 10:11:24 +00:00
const obj = { id : String ( Date . now ( ) ) , title : "" , options : [ ] , singleSelect : false , required : false , inOnboarding } ;
2026-07-21 06:55:02 +00:00
obj . type = obj . MULTIPLE_CHOICE ;
2026-07-20 16:05:17 +00:00
return obj ;
} ;
export const clientPromptToServerPrompt = function clientPromptToServerPrompt ( id ) {
const options = id . options ;
return {
id : id.id ,
options : options.map ( ( id ) = > {
const obj = { id : id.id , channel_ids : id.channelIds , role_ids : id.roleIds , emoji : id.emoji } ;
const emoji = id . emoji ;
id = undefined ;
if ( null != emoji ) {
id = emoji . id ;
}
obj . emoji_id = id ;
const emoji2 = id . emoji ;
let name ;
if ( null != emoji2 ) {
name = emoji2 . name ;
}
obj . emoji_name = name ;
const emoji3 = id . emoji ;
let animated ;
if ( null != emoji3 ) {
animated = emoji3 . animated ;
}
obj . emoji_animated = animated ;
( { title : obj.title , description : obj.description } = id ) ;
return obj ;
} ) ,
title : id.title ,
single_select : id.singleSelect ,
disabled : id.disabled ,
required : id.required ,
in_onboarding : id.inOnboarding ,
type : id . type
} ;
} ;
export { serverPromptToClientPrompt } ;
export const serverApiResponseToClientState = function serverApiResponseToClientState ( defaultChannelIds ) {
let connections ;
let onboarding_prompts_seen ;
const obj = { prompts : prompts.map ( serverPromptToClientPrompt ) , defaultChannelIds : defaultChannelIds.default_channel_ids } ;
2026-07-23 10:11:24 +00:00
prompts = defaultChannelIds . prompts ;
2026-07-20 16:05:17 +00:00
let responses = defaultChannelIds . responses ;
if ( null == responses ) {
responses = [ ] ;
}
obj . responses = responses ;
( { mode : obj.mode , enabled : obj.enabled , onboarding_prompts_seen } = defaultChannelIds ) ;
if ( null == onboarding_prompts_seen ) {
onboarding_prompts_seen = { } ;
}
obj . onboardingPromptsSeen = onboarding_prompts_seen ;
let prop = defaultChannelIds . onboarding_responses_seen ;
if ( null == prop ) {
prop = { } ;
}
obj . onboardingResponsesSeen = prop ;
( { below_requirements : obj.belowRequirements , connections } = defaultChannelIds ) ;
if ( null == connections ) {
connections = [ ] ;
}
obj . connections = connections ;
let prop1 = defaultChannelIds . additional_connections ;
if ( null == prop1 ) {
prop1 = [ ] ;
}
obj . additionalConnections = prop1 ;
return obj ;
} ;
export const isEmojiEmpty = function isEmojiEmpty ( id ) {
let tmp = null == id ;
if ( ! tmp ) {
tmp = null == id . id && null == id . name ;
const tmp2 = null == id . id && null == id . name ;
}
return tmp ;
} ;
export const EXCLUDED_ONBOARDING_PLATFORM_TYPES = set ;
export { getConnectionIdentifier } ;
export const parseConnectionIdentifier = function parseConnectionIdentifier ( str ) {
const tmp = callback ( str . split ( ":" ) , 2 ) ;
const first = tmp [ 0 ] ;
if ( "app" === first ) {
if ( undefined !== tmp3 ) {
if ( "" !== tmp3 ) {
let obj = { } ;
obj . type = obj . APPLICATION ;
obj . applicationId = tmp3 ;
let tmp4 = obj ;
}
return tmp4 ;
}
}
tmp4 = null ;
if ( "provider" === first ) {
tmp4 = null ;
if ( undefined !== tmp3 ) {
tmp4 = null ;
if ( "" !== tmp3 ) {
obj = { } ;
obj . type = obj . PROVIDER_CONNECTED_ACCOUNT ;
obj . providerId = tmp3 ;
tmp4 = obj ;
}
}
}
} ;
export { validateOnboardingConnection } ;
export const validateOnboardingConnections = function validateOnboardingConnections ( arr ) {
let done ;
2026-07-23 10:11:24 +00:00
let items = [ ] ;
const set = new Set ( ) ;
2026-07-20 16:05:17 +00:00
function _loop ( arg0 ) {
let items = arg0 ;
2026-07-23 10:11:24 +00:00
let arr = outer1_16 ( closure_2 ) ;
items = [ . . . arr . map ( ( arg0 ) = > "Connection " + closure_0 + 1 + ": " + arg0 ) ] ;
2026-07-20 16:05:17 +00:00
items . push . apply ( items ) ;
2026-07-23 10:11:24 +00:00
const tmp2 = outer1_15 ( closure_2 ) ;
2026-07-20 16:05:17 +00:00
if ( set . has ( tmp2 ) ) {
arr = items . push ( "Duplicate connection configuration" ) ;
}
set . add ( tmp2 ) ;
}
2026-07-23 10:11:24 +00:00
let tmp2 = _createForOfIteratorHelperLoose ( arr . entries ( ) ) ;
2026-07-20 16:05:17 +00:00
let iter = tmp2 ( ) ;
if ( ! iter . done ) {
do {
2026-07-23 10:11:24 +00:00
let tmp3 = callback ;
let tmp4 = callback ( iter . value , 2 ) ;
let dependencyMap = tmp4 [ 1 ] ;
2026-07-20 16:05:17 +00:00
let _loopResult = _loop ( tmp4 [ 0 ] ) ;
let iter2 = tmp2 ( ) ;
iter = iter2 ;
done = iter2 . done ;
} while ( ! done ) ;
}
return items ;
} ;