local Z=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local I=Z:WaitForChild("\077\111\100\117\108\101\115")local S=require(I.src.utils.Logger)local C=require(I.src.utils.Dict)local f=require(I.M)local L=require(I.src.AudioPlayer)local n={{time=os.time();text="\078\111\116\105\102\105 \049",thumbnail="\114\098\120\097\115\115\101\116\058\047\047\116\101\120\116\117\114\101\115\047\117\105\047\071\117\105\073\109\097\103\101\080\108\097\099\101\104\111\108\100\101\114\046\112\110\103";rectSize=Vector2.new(0,0);rectOffset=Vector2.new(0,0);statusColor=Color3.fromRGB(20,20,40);layoutIndex=0};{time=os.time()+1;text="\078\111\116\105\102 \050",thumbnail="\114\098\120\097\115\115\101\116\058\047\047\116\101\120\116\117\114\101\115\047\117\105\047\071\117\105\073\109\097\103\101\080\108\097\099\101\104\111\108\100\101\114\046\112\110\103";rectSize=Vector2.new(0,0),rectOffset=Vector2.new(0,0),statusColor=Color3.fromRGB(20,20,40);layoutIndex=0}}local function y(Z,I)Z=Z or{notifications={}}if I.type=="\099\108\105\101\110\116\083\101\110\100\078\111\116\105\102\105\099\097\116\105\111\110"then S:d("\099\108\105\101\110\116\083\101\110\100\078\111\116\105\102\105\099\097\116\105\111\110\058",I.playerId)L.playAudio("\078\111\116\105\102\105\099\097\116\105\111\110")local n={time=I.time,text=I.text,thumbnail=I.thumbnail}return C.join(Z,{notifications=f.append(Z.notifications,{n})})end return Z end return y
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local Modules = ReplicatedStorage:WaitForChild('Modules')
local logger = require(Modules.src.utils.Logger)
local Dict = require(Modules.src.utils.Dict)
local M = require(Modules.M)
local AudioPlayer = require(Modules.src.AudioPlayer)

local dummyNotifications = { {
	time = os.time(),
	text = 'Notifi 1',
	thumbnail = 'rbxasset://textures/ui/GuiImagePlaceholder.png',
	rectSize = Vector2.new(0, 0),
	rectOffset = Vector2.new(0, 0),
	statusColor = Color3.fromRGB(20, 20, 40),
	layoutIndex = 0,
}, {
	time = os.time() + 1,
	text = 'Notif 2',
	thumbnail = 'rbxasset://textures/ui/GuiImagePlaceholder.png',
	rectSize = Vector2.new(0, 0),
	rectOffset = Vector2.new(0, 0),
	statusColor = Color3.fromRGB(20, 20, 40),
	layoutIndex = 0,
} }

local function messages(state, action)
	state = state or {
		notifications = {},
	}

	if action.type == 'clientSendNotification' then
		logger:d('clientSendNotification:', action.playerId)
		-- TODO: Find better place to call this. not in reducer.
		AudioPlayer.playAudio('Notification')

		local notification = {
			time = action.time,
			text = action.text,
			thumbnail = action.thumbnail,
		}

		return Dict.join(state, { notifications = M.append(state.notifications, { notification }) })
	end

	return state
end

return messages