local function D(D,Y,n)return function(...)local g={wpcall(D,...)}local u=table.remove(g,1)if u then Y(unpack(g))else n(unpack(g))end end end local function Y(D)return next(D)==nil end local n={}n.__index=n n.Status={Started="\083\116\097\114\116\101\100",Resolved="\082\101\115\111\108\118\101\100",Rejected="\082\101\106\101\099\116\101\100"}

local function createAdvancer(callback, resolve, reject)
	return function(...)
		local result = { wpcall(callback, ...) }
		local ok = table.remove(result, 1)

		if ok then
			resolve(unpack(result))
		else
			reject(unpack(result))
		end
	end
end

local function isEmpty(t)
	return next(t) == nil
end

local Promise = {}
Promise.__index = Promise

Promise.Status = {
	Started = "Started",
	Resolved = "Resolved",
	Rejected = "Rejected",
}
