function Blend.mount(o,p)assert(typeof(o)=="\073\110\115\116\097\110\099\101","\066\097\100 \105\110\115\116\097\110\099\101")local O=Maid.new()local K=nil local T={}for p,y in pairs(p)do if type(p)=="\115\116\114\105\110\103"then if p=="\080\097\114\101\110\116"then K=y else local K=Blend.toPropertyObservable(y)if K then O:GiveTask(K:Subscribe(function(O)task.spawn(function()o[p]=O end)end))else task.spawn(function()o[p]=y end)end end elseif type(p)=="\102\117\110\099\116\105\111\110"then local O=Blend.toEventObservable(p(o,y))if Observable.isObservable(O)then table.insert(T,{O,y})else warn(("\085\110\097\098\108\101 \116\111 \097\112\112\108\121 \101\118\101\110\116 \108\105\115\116\101\110\101\114 \037\113"):format(tostring(p)))end elseif type(p)=="\110\117\109\098\101\114"then table.insert(T,{Blend.Children(o,y);y})else warn(("\085\110\097\098\108\101 \116\111 \097\112\112\108\121 \112\114\111\112\101\114\116\121 \037\113"):format(tostring(p)))end end for o,p in pairs(T)do O:GiveTask(p[1]:Subscribe(Blend.toEventHandler(p[2])))end if K then local p=Blend.toPropertyObservable(K)if p then O:GiveTask(p:Subscribe(function(p)o.Parent=p end))else o.Parent=K end end return O end return Blend

function Blend.mount(instance, props)
	assert(typeof(instance) == "Instance", "Bad instance")

	local maid = Maid.new()

	local parent = nil
	local dependentObservables = {}

	for key, value in pairs(props) do
		if type(key) == "string" then
			if key == "Parent" then
				parent = value
			else
				local observable = Blend.toPropertyObservable(value)
				if observable then
					maid:GiveTask(observable:Subscribe(function(result)
						task.spawn(function()
							instance[key] = result
						end)
					end))
				else
					task.spawn(function()
						instance[key] = value
					end)
				end
			end
		elseif type(key) == "function" then
			local observable = Blend.toEventObservable(key(instance, value))

			if Observable.isObservable(observable) then
				table.insert(dependentObservables, {observable, value})
			else
				warn(("Unable to apply event listener %q"):format(tostring(key)))
			end
		elseif type(key) == "number" then
			-- Treat this as an implicit children contract
			-- Thus, we don't need an explicit [Blend.Children] call.
			table.insert(dependentObservables, { Blend.Children(instance, value), value })
		else
			warn(("Unable to apply property %q"):format(tostring(key)))
		end
	end

	-- Subscribe dependentObservables (which includes adding children)
	for _, event in pairs(dependentObservables) do
		maid:GiveTask(event[1]:Subscribe(Blend.toEventHandler(event[2])))
	end

	if parent then
		local observable = Blend.toPropertyObservable(parent)
		if observable then
			maid:GiveTask(observable:Subscribe(function(result)
				instance.Parent = result
			end))
		else
			instance.Parent = parent
		end
	end

	return maid
end


return Blend
