local m=script.Parent.Parent return function(Y)local n=require(m.Bundles)local k=n.data local h=n.themeSystem local P=n.icons local A=n.Fusion local L=A.New local u=A.Children local K=A.Value local X=A.Observer local V=A.OnEvent local S=A.Computed local s=require(m.utilities)local g=s.get local p=s.animate local c=s.typecheck local O=s.customFont local l=s.drag local o=s.references local G=s.connections local b=require(m.simpleElements)local J=b.UIListLayout local N=b.UIPadding local t=b.UICorner local j=Enum.SortOrder local a=Enum.FillDirection local F=Enum.HorizontalAlignment local U=Enum.VerticalAlignment local E,v=c(Y,{Name={};Children={}},{})assert(E,table.concat(v,"\n"))local z=k.find("\105\110\115\116\097\110\099\101\078\097\109\101")local B=k.find("\097\098\115\111\108\117\116\101\079\102\102\115\101\116")local e=Y.Name local d=K(Y.Children)local R=o.get(g(z.name))local Z=K(false)local M M=(L("\084\101\120\116\066\117\116\116\111\110"))({Parent=R;Size=UDim2.fromOffset(240,11);Position=UDim2.fromOffset(10,10+g(B.number)),BackgroundTransparency=1;[V("\077\111\117\115\101\066\117\116\116\111\110\049\068\111\119\110")]=function()Z:set(true)end,[u]={(L("\070\114\097\109\101"))({Position=UDim2.new(.5,-120,0,0),Size=UDim2.fromOffset(240,0);BackgroundColor3=h.background2;AutomaticSize=Enum.AutomaticSize.Y;[u]={t(4),N(8);(L("\084\101\120\116\066\117\116\116\111\110"))({AnchorPoint=Vector2.new(1,0);Position=UDim2.fromScale(1,0),Size=UDim2.fromOffset(32,32),BackgroundColor3=h.selectedTab,[V("\065\099\116\105\118\097\116\101\100")]=function()M:Destroy()end,[u]={t(6);(L("\073\109\097\103\101\076\097\098\101\108"))({AnchorPoint=Vector2.new(.5,.5),Position=UDim2.fromScale(.5,.5),Size=UDim2.fromOffset(30,30),BackgroundTransparency=1;Image=P.close;ImageColor3=h.red,ImageTransparency=0})}});(L("\070\114\097\109\101"))({BackgroundTransparency=1;Size=UDim2.new(1,0,0,0),AutomaticSize=Enum.AutomaticSize.Y;[u]={J(j.LayoutOrder,a.Vertical,F.Center,U.Top,UDim.new(0,8)),(L("\070\114\097\109\101"))({Size=p(function()return g(Z)and UDim2.new(.4,0,0,6)or UDim2.new(.25,0,0,6)end,40,1);BackgroundColor3=h.text2;BackgroundTransparency=p(function()return g(Z)and 0 or.5 end,40,1);[u]={t(6)}});(L("\070\114\097\109\101"))({Size=UDim2.new(1,0,0,0);BackgroundTransparency=1;AutomaticSize=Enum.AutomaticSize.Y,[u]={(L("\084\101\120\116\076\097\098\101\108"))({Size=UDim2.new(1,-40,0,18),BackgroundTransparency=1,FontFace=O("\077\111\110\116\115\101\114\114\097\116",Enum.FontWeight.Bold);TextColor3=h.text;TextScaled=true;Text=e,TextXAlignment=Enum.TextXAlignment.Left;RichText=true}),(L("\070\114\097\109\101"))({Size=UDim2.new(1,0,0,0);Position=UDim2.fromOffset(0,26);BackgroundTransparency=1,AutomaticSize=Enum.AutomaticSize.Y,[u]=d})}})}})}})}})local C,I=l(M,15)local i=I:Connect(function()Z:set(false)end)G.add(C)G.add(i)M.Destroying:Once(function()C:Disconnect()i:Disconnect()end)return M,function(...)d:set(...)end end
local darius = script.Parent.Parent
return function(property)
	local Bundles = require(darius.Bundles)
	local data = Bundles.data
	local theme = Bundles.themeSystem
	local icons = Bundles.icons
	local Fusion = Bundles.Fusion
		local new = Fusion.New
		local children = Fusion.Children
		local value = Fusion.Value
		local observe = Fusion.Observer
		local onevent = Fusion.OnEvent
		local computed = Fusion.Computed

	local utilities = require(darius.utilities)
	local get = utilities.get
	local animate = utilities.animate
	local typecheck = utilities.typecheck
	local customFont = utilities.customFont
    local drag = utilities.drag
    local references = utilities.references
    local connections = utilities.connections

	local simpleElements = require(darius.simpleElements)
	local UIListLayout = simpleElements.UIListLayout
	local UIPadding = simpleElements.UIPadding
	local UICorner = simpleElements.UICorner
	local SO = Enum.SortOrder
	local FD = Enum.FillDirection
	local HA = Enum.HorizontalAlignment
	local VA = Enum.VerticalAlignment

	-- Typecheck

	local didPass, failedItems = typecheck(property,{
		Name = {},
        Children = {}
	},{})
	assert(didPass, table.concat(failedItems, "\n"))

    -- Data

    local instanceName = data.find("instanceName")
    local absoluteOffset = data.find("absoluteOffset")

    -- Properties

    local name = property.Name
    local _children = value(property.Children)

    -- Variables

    local screenGui = references.get(get(instanceName.name))
    local down = value(false)

    -- Module

    local module
    module = new "TextButton" {
        Parent = screenGui,
        Size = UDim2.fromOffset(240,11),
        Position = UDim2.fromOffset(10,10 + get(absoluteOffset.number)),
        BackgroundTransparency = 1,

        [onevent "MouseButton1Down"] = function()
            down:set(true)
        end,

        [children] = {
            new "Frame" {
                Position = UDim2.new(0.5,-120,0,0),
                Size = UDim2.fromOffset(240,0),
                BackgroundColor3 = theme.background2,
                AutomaticSize = Enum.AutomaticSize.Y,

                [children] = {
                    UICorner(4),
                    UIPadding(8),
                    new "TextButton" {
                        AnchorPoint = Vector2.new(1,0),
                        Position = UDim2.fromScale(1,0),
                        Size = UDim2.fromOffset(32,32),
                        BackgroundColor3 = theme.selectedTab,

                        [onevent "Activated"] = function()
                            module:Destroy()
                        end,

                        [children] = {
                            UICorner(6),
                            new "ImageLabel" {
                                AnchorPoint = Vector2.new(0.5,0.5),
                                Position = UDim2.fromScale(0.5,0.5),
                                Size = UDim2.fromOffset(30,30),
                                BackgroundTransparency = 1,
                                Image = icons.close,
                                ImageColor3 = theme.red,
                                ImageTransparency = 0
                            }
                        }
                    },
                    new "Frame" {
                        BackgroundTransparency = 1,
                        Size = UDim2.new(1,0,0,0),
                        AutomaticSize = Enum.AutomaticSize.Y,

                        [children] = {
                            UIListLayout(SO.LayoutOrder,FD.Vertical,HA.Center,VA.Top,UDim.new(0,8)),
                            new "Frame" {
                                Size = animate(function()
                                    return get(down) and UDim2.new(0.4,0,0,6) or UDim2.new(0.25,0,0,6)
                                end,40,1),
                                BackgroundColor3 = theme.text2,
                                BackgroundTransparency = animate(function()
                                    return get(down) and 0 or 0.5
                                end,40,1),

                                [children] = {
                                    UICorner(6)
                                }
                            },
                            new "Frame" {
                                Size = UDim2.new(1,0,0,0),
                                BackgroundTransparency = 1,
                                AutomaticSize = Enum.AutomaticSize.Y,

                                [children] = {
                                    new "TextLabel" {
                                        Size = UDim2.new(1,-40,0,18),
                                        BackgroundTransparency = 1,
                                        FontFace = customFont("Montserrat", Enum.FontWeight.Bold),
                                        TextColor3 = theme.text,
                                        TextScaled = true,
                                        Text = name,
                                        TextXAlignment = Enum.TextXAlignment.Left,
								        RichText = true
                                    },
                                    new "Frame" {
                                        Size = UDim2.new(1,0,0,0),
                                        Position = UDim2.fromOffset(0,26),
                                        BackgroundTransparency = 1,
                                        AutomaticSize = Enum.AutomaticSize.Y,

                                        [children] = _children
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

    }

    local connection, onEnd = drag(module, 15)
    local connection2 = onEnd:Connect(function()
        down:set(false)
    end)
    connections.add(connection)
    connections.add(connection2)
    module.Destroying:Once(function()
        connection:Disconnect()
        connection2:Disconnect()
    end)
    return module, function(...)
        _children:set(...)
    end
end