local Z=script:FindFirstAncestor("\077\097\122\101\071\101\110\101\114\097\116\111\114\080\108\117\103\105\110")local I=Z.Plugin local S=require(I.Config)local C=require(Z.M)return function(Z,I)Z=Z or{height=S.defaultWidth,width=S.defaultWidth;wallMaterial=Enum.Material.Grass,groundMaterial=Enum.Material.Sand;onlyBlocks=false;addRandomModels=true;addStartAndFinish=true;addKillBlocks=true;addCeiling=false,partThickness=S.defaultThickness;location=workspace}if I.type=="\083\101\116\083\101\116\116\105\110\103\115"then return C.extend({},Z,I.settings)end return Z end
local Root = script:FindFirstAncestor('MazeGeneratorPlugin')

local Plugin = Root.Plugin
local Config = require(Plugin.Config)
local M = require(Root.M)

return function(state, action)
	state = state or {
		height = Config.defaultWidth,
		width = Config.defaultWidth,
		wallMaterial = Enum.Material.Grass,
		groundMaterial = Enum.Material.Sand,
		onlyBlocks = false,
		addRandomModels = true,
		addStartAndFinish = true,
		addKillBlocks = true,
		addCeiling = false,
		partThickness = Config.defaultThickness,
		location = workspace,
	}

	if action.type == 'SetSettings' then
		return M.extend({}, state, action.settings)
	end

	return state
end