local N=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local P=N:WaitForChild("\099\111\109\109\111\110")local b=require(P.util:WaitForChild("\098\121"))local a=require(P.util:WaitForChild("\099\111\109\112\105\108\101\083\117\098\109\111\100\117\108\101\115\084\111\065\114\114\097\121"))local g=a(script,true)for N,P in pairs(g)do P.shopCatagory=P.shopCatagory or P.type end local function S(N,P)return N.rarity<P.rarity end table.sort(g,S)return{all=g,byId=b("\105\100",g),basic=b("\105\100",a(script.basic,true))}
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local common = ReplicatedStorage:WaitForChild("common")

local by = require(common.util:WaitForChild("by"))
local compileSubmodulesToArray = require(common.util:WaitForChild("compileSubmodulesToArray"))
local assets = compileSubmodulesToArray(script, true)

for _, asset in pairs(assets) do
    asset.shopCatagory = asset.shopCatagory or asset.type
end

local function isLessRare(asset1,asset2)
    return asset1.rarity < asset2.rarity
end

table.sort(assets,isLessRare)

return {
    all = assets,
    byId = by("id", assets),
    basic = by("id", compileSubmodulesToArray(script.basic,true)) -- basic hats by id
}