local function w(w)if w.LocalUserId then return w.LocalUserId end if w.RobloxUser and w.RobloxUser.rbxuid then return tostring(w.RobloxUser.rbxuid)end return nil end return function(G,l,T)return function(e)local h=(e:getState()).AvatarExperience.AvatarEditor.Categories.category local j=(e:getState()).AvatarExperience.AvatarEditor.Categories.subcategory local C=w(e:getState())G(l,h,j,T,C)end end
--[[
	Calls the given analytics function and passes the given values.
	Every analytics function sends the categoryIndex and subcategoryIndex from the store.
	assetTypeId: optional
]]

local function getUserId(state)
	if state.LocalUserId then
		return state.LocalUserId
	end

	if state.RobloxUser and state.RobloxUser.rbxuid then
		return tostring(state.RobloxUser.rbxuid)
	end

	return nil
end

return function(analyticsFunction, value, assetTypeId)
	return function(store)
		local categoryIndex = store:getState().AvatarExperience.AvatarEditor.Categories.category
		local subcategoryIndex = store:getState().AvatarExperience.AvatarEditor.Categories.subcategory
		local userId = getUserId(store:getState())
		analyticsFunction(value, categoryIndex, subcategoryIndex, assetTypeId, userId)
	end
end
