local x=ReplicatedStorage.AvatarEditor local g=x.RemoteEvent local u=require(x.Shared.Util.Maid)local e=require(x.Shared.Util.TableUtil)local Y=require(x.Shared.Util.Spring)local v=require(x.Shared.Util.Signal)local R=require(x.Shared.QueryMap)local G=require(x.Shared.CatalogData)local E=require(x.Shared.Colors)local r=require(x.Shared.Settings)local j=require(x.Shared.UserCanUse)local V=require(x.Client.TabButton)local W=require(x.Client.Search)local U=require(x.Client.CatalogList)local l=require(x.Client.Wearing)local o=require(x.Client.PromptOverlay)local s=require(x.Client.ColorList)local d=require(x.Client.Scale)local Z=require(x.Client.Costume)local S=require(x.Client.Theme)local J=require(x.Client.Config)local T=Players.LocalPlayer local h=x.AvatarEditorGui local w=h.Frame.Editor local m=w.Body local M=w.Footer local B=h.Frame.Viewport local b=B.Footer.Expand local L=m.Main local F=L.Header local N=L.Container local P=m.UIPageLayout local X=F.SubTabs.UIPageLayout local O=1 local K=1 local a=0 local z={}local p={}local Q=Y.new(0)Q.Damper=1 Q.Speed=20 local q=u.new()local D,c,t,I,y,A,C local H={search="";assetType=8;wearing=false,uid=""}local i={}i.Started=v.new()i.Loaded=v.new()i.PermissionFailed=v.new()i.Destroyed=v.new()


local AvatarEditor = ReplicatedStorage.AvatarEditor
local remoteEvent = AvatarEditor.RemoteEvent
local Maid = require(AvatarEditor.Shared.Util.Maid)
local TableUtil = require(AvatarEditor.Shared.Util.TableUtil)
local Spring = require(AvatarEditor.Shared.Util.Spring)
local Signal = require(AvatarEditor.Shared.Util.Signal)
local QueryMap = require(AvatarEditor.Shared.QueryMap)
local CatalogData = require(AvatarEditor.Shared.CatalogData)
local Colors = require(AvatarEditor.Shared.Colors)
local Settings = require(AvatarEditor.Shared.Settings)
local UserCanUse = require(AvatarEditor.Shared.UserCanUse)
local TabButton = require(AvatarEditor.Client.TabButton)
local Search = require(AvatarEditor.Client.Search)
local CatalogList = require(AvatarEditor.Client.CatalogList)
local Wearing = require(AvatarEditor.Client.Wearing)
local PromptOverlay = require(AvatarEditor.Client.PromptOverlay)
local ColorList = require(AvatarEditor.Client.ColorList)
local Scale = require(AvatarEditor.Client.Scale)
local Costume = require(AvatarEditor.Client.Costume)
local Theme = require(AvatarEditor.Client.Theme)
local Config = require(AvatarEditor.Client.Config)

local player = Players.LocalPlayer

local mainGui = AvatarEditor.AvatarEditorGui
local editorFrame = mainGui.Frame.Editor
local bodyFrame = editorFrame.Body
local footer = editorFrame.Footer

local viewportFrame = mainGui.Frame.Viewport
local expandButton = viewportFrame.Footer.Expand

local mainFrame = bodyFrame.Main
local mainHeader = mainFrame.Header
local mainContainer = mainFrame.Container

local bodyPageLayout = bodyFrame.UIPageLayout
local subcategoryPageLayout = mainHeader.SubTabs.UIPageLayout

local bodyPageIndex = 1
local categoryPageIndex = 1
local subcategoryPageIndex = 0

local categoryButtons = {}
local subcategoryButtons = {}

local tweenSpring = Spring.new(0)
tweenSpring.Damper = 1
tweenSpring.Speed = 20

local maid = Maid.new()

local search, catalogList, promptOverlay, colorList, scale, costume, config

local searchState = {
	search = "",
	assetType = 8,
	wearing = false,
	uid = "",
}

local module = {}
module.Started = Signal.new()
module.Loaded = Signal.new()
module.PermissionFailed = Signal.new()
module.Destroyed = Signal.new()

