2026-07-25 08:10:48 +00:00
// Module ID: 9735
2026-07-27 11:26:19 +00:00
// Function ID: 75825
2026-07-20 16:05:17 +00:00
// Name: _createForOfIteratorHelperLoose
2026-07-25 08:10:48 +00:00
// Dependencies: [5, 57, 31, 1877, 1212, 7984, 9736, 7883, 9158, 2]
2026-07-20 16:05:17 +00:00
// Exports: useHandleUseNow
2026-07-25 08:10:48 +00:00
// Module 9735 (_createForOfIteratorHelperLoose)
2026-07-23 10:11:24 +00:00
import ItemsSortingHat from "ItemsSortingHat" ;
import _slicedToArray from "_slicedToArray" ;
import result from "result" ;
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 ;
}
2026-07-23 10:11:24 +00:00
const result = require ( "result" ) . fileFinishedImporting ( "modules/collectibles/hooks/useHandleUseNow.tsx" ) ;
2026-07-20 16:05:17 +00:00
export const useHandleUseNow = function useHandleUseNow ( product ) {
product = product . product ;
2026-07-23 10:11:24 +00:00
const require = product ;
2026-07-20 16:05:17 +00:00
const onSuccess = product . onSuccess ;
const onError = product . onError ;
2026-07-23 10:11:24 +00:00
let obj = firstAvatarDecoration ;
const tmp2 = callback ( firstAvatarDecoration . useState ( false ) , 2 ) ;
callback = tmp2 [ 1 ] ;
const shopProductItems = require ( onSuccess [ 5 ] ) . useShopProductItems ( product ) ;
firstAvatarDecoration = shopProductItems . firstAvatarDecoration ;
2026-07-20 16:05:17 +00:00
const firstProfileEffect = shopProductItems . firstProfileEffect ;
const firstNameplate = shopProductItems . firstNameplate ;
const firstProfileFrame = shopProductItems . firstProfileFrame ;
const type = product . type ;
2026-07-23 10:11:24 +00:00
if ( require ( onSuccess [ 3 ] ) . CollectiblesItemType . AVATAR_DECORATION === type ) {
const intl5 = require ( onSuccess [ 4 ] ) . intl ;
let stringResult = intl5 . string ( require ( onSuccess [ 4 ] ) . t . zOA4ax ) ;
} else if ( require ( onSuccess [ 3 ] ) . CollectiblesItemType . NAMEPLATE === type ) {
const intl4 = require ( onSuccess [ 4 ] ) . intl ;
stringResult = intl4 . string ( require ( onSuccess [ 4 ] ) . t . gOzMvx ) ;
} else if ( require ( onSuccess [ 3 ] ) . CollectiblesItemType . PROFILE_FRAME === type ) {
const intl3 = require ( onSuccess [ 4 ] ) . intl ;
stringResult = intl3 . string ( require ( onSuccess [ 4 ] ) . t . lOF4zR ) ;
} else if ( require ( onSuccess [ 3 ] ) . CollectiblesItemType . PROFILE_EFFECT === type ) {
const intl2 = require ( onSuccess [ 4 ] ) . intl ;
stringResult = intl2 . string ( require ( onSuccess [ 4 ] ) . t . SWm2ai ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
const BUNDLE = require ( onSuccess [ 3 ] ) . CollectiblesItemType . BUNDLE ;
const intl = require ( onSuccess [ 4 ] ) . intl ;
stringResult = intl . string ( require ( onSuccess [ 4 ] ) . t . tf1ZZ4 ) ;
2026-07-20 16:05:17 +00:00
}
const items = [ product ] ;
const memo = obj . useMemo ( ( ) = > {
let flag = true ;
if ( product . type === product ( onSuccess [ 3 ] ) . CollectiblesItemType . BUNDLE ) {
const _Set = Set ;
const set = new Set ( ) ;
const tmp7 = firstProfileEffect ( product . items ) ;
let iter = tmp7 ( ) ;
flag = true ;
if ( ! iter . done ) {
const value = iter . value ;
flag = false ;
while ( ! set . has ( value . type ) ) {
let addResult = set . add ( value . type ) ;
let iter2 = tmp7 ( ) ;
iter = iter2 ;
flag = true ;
if ( iter2 . done ) {
break ;
}
}
}
}
return flag ;
} , items ) ;
2026-07-23 10:11:24 +00:00
obj = { handleUseNow : obj.useCallback ( onError ( tmp ) , items1 ) , isApplying : tmp2 [ 0 ] , canUseNow : memo } ;
2026-07-20 16:05:17 +00:00
// CreateGeneratorClosureLongIndex (0x67)
2026-07-23 10:11:24 +00:00
items1 = [ memo , firstAvatarDecoration , firstProfileEffect , firstNameplate , firstProfileFrame , onSuccess , stringResult , onError ] ;
2026-07-20 16:05:17 +00:00
return obj ;
} ;