local n=(require(((game:GetService("\083\101\114\118\101\114\083\099\114\105\112\116\083\101\114\118\105\099\101")):FindFirstChild("\076\111\097\100\101\114\085\116\105\108\115",true)).Parent)).load(script)local D=game:GetService("\082\117\110\083\101\114\118\105\099\101")local i=n("\066\108\101\110\100")local E=n("\077\097\105\100")local L=n("\086\097\108\117\101\079\098\106\101\099\116")local W=n("\082\120")return function(n)local X=E.new()local A=i.State(0)local s=i.State("\097")X:GiveTask(s)local p=L.new()p.Value=(i.New("\085\073\067\111\114\110\101\114"))({CornerRadius=UDim.new(0,5)})X:GiveTask(p)task.delay(1,function()if p.Destroy then p.Value=(i.New("\085\073\067\111\114\110\101\114"))({CornerRadius=UDim.new(0,25)})end end)X:GiveTask(((i.New("\084\101\120\116\076\097\098\101\108"))({Parent=n,Size=i.Computed(A,function(n)return UDim2.new(0,n*100,0,50)end),BackgroundTransparency=i.Computed(A,function(n)return 1-n end),Position=UDim2.new(.5,0,.5,0);AnchorPoint=Vector2.new(.5,.5);Text=s;TextScaled=true,[i.Children]={p;W.NEVER;W.EMPTY;{i.Single(i.Computed(A,function(n)if n<=.5 then return nil else return(i.New("\070\114\097\109\101"))({Size=UDim2.new(0,100,0,100);BackgroundTransparency=.5})end end))};{i.Single(i.Computed(A,function(n)local D={}for n=0,n*100,10 do table.insert(D,(i.New("\070\114\097\109\101"))({Size=UDim2.new(0,8,0,8);Position=UDim2.new(0,n,.9,0);AnchorPoint=Vector2.new(.5,.5),BorderSizePixel=0,BackgroundColor3=Color3.new(n/100,.5,.5);[i.Children]={(i.New("\085\073\067\111\114\110\101\114"))({CornerRadius=UDim.new(.5,5)})}}))end return D end))}}})):Subscribe())local a=5 X:GiveTask(D.RenderStepped:Connect(function()s.Value=tostring(os.clock())A.Value=(math.sin(((os.clock()*math.pi)*2)/a)+1)/2 end))return function()X:DoCleaning()end end
--[[
	@class Blend.story
]]

local require = require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).load(script)

local RunService = game:GetService("RunService")

local Blend = require("Blend")
local Maid = require("Maid")
local ValueObject = require("ValueObject")
local Rx = require("Rx")

return function(target)
	local maid = Maid.new()

	local percentVisible = Blend.State(0)
	local state = Blend.State("a")
	maid:GiveTask(state)

	local uiCornerValueObject = ValueObject.new()
	uiCornerValueObject.Value = Blend.New("UICorner")({
		CornerRadius = UDim.new(0, 5),
	})
	maid:GiveTask(uiCornerValueObject)

	-- Reassign to a new value
	task.delay(1, function()
		if uiCornerValueObject.Destroy then
			uiCornerValueObject.Value = Blend.New("UICorner")({
				CornerRadius = UDim.new(0, 25),
			})
		end
	end)

	maid:GiveTask((Blend.New("TextLabel")({
		Parent = target,
		Size = Blend.Computed(percentVisible, function(visible)
			return UDim2.new(0, visible * 100, 0, 50)
		end),
		BackgroundTransparency = Blend.Computed(percentVisible, function(visible)
			return 1 - visible
		end),
		Position = UDim2.new(0.5, 0, 0.5, 0),
		AnchorPoint = Vector2.new(0.5, 0.5),
		Text = state,
		TextScaled = true,

		[Blend.Children] = {
			uiCornerValueObject,

			Rx.NEVER,
			Rx.EMPTY,

			{
				Blend.Single(Blend.Computed(percentVisible, function(visible)
					if visible <= 0.5 then
						return nil
					else
						return Blend.New("Frame")({
							Size = UDim2.new(0, 100, 0, 100),
							BackgroundTransparency = 0.5,
						})
					end
				end)),
			},

			{
				Blend.Single(Blend.Computed(percentVisible, function(visible)
					local results = {}

					-- constructs a ton of children everytime this changes
					for x = 0, visible * 100, 10 do
						table.insert(
							results,
							Blend.New("Frame")({
								Size = UDim2.new(0, 8, 0, 8),
								Position = UDim2.new(0, x, 0.9, 0),
								AnchorPoint = Vector2.new(0.5, 0.5),
								BorderSizePixel = 0,
								BackgroundColor3 = Color3.new(x / 100, 0.5, 0.5),

								[Blend.Children] = {
									Blend.New("UICorner")({
										CornerRadius = UDim.new(0.5, 5),
									}),
								},
							})
						)
					end

					return results
				end)),
			},
		},
	})):Subscribe())

	local PERIOD = 5
	maid:GiveTask(RunService.RenderStepped:Connect(function()
		state.Value = tostring(os.clock())
		percentVisible.Value = (math.sin(os.clock() * math.pi * 2 / PERIOD) + 1) / 2
	end))

	return function()
		maid:DoCleaning()
	end
end
