ClientOrchestration.ClientSceneMetadataEvent=Orchestra.Events.ClientEvents.ClientSceneMetadata ClientOrchestration.SendMediaControllerConfig=Orchestra.Events.MediaControllerConfigEvents.SendMediaControllerConfig ClientOrchestration.Seek=Orchestra.Events.ClientEvents.Seek ClientOrchestration.SceneEnded=Orchestra.Events.ClientEvents.SceneEnded ClientOrchestration.SeekPermissionsEvent=Orchestra.Events.ClientEvents.SeekPermissions ClientOrchestration.SeekerGuiComponent=nil ClientOrchestration.playerGui=Players.LocalPlayer:WaitForChild("\080\108\097\121\101\114\071\117\105")ClientOrchestration.taskLib=task ClientOrchestration._warn=function(t)warn(t)end ClientOrchestration._require=function(t)return require(t)end ClientOrchestration.handleSeekPermissionsEvent=function(t)if t and not ClientOrchestration.SeekerGuiComponent then local t=ClientOrchestration.Roact.createElement(ClientOrchestration.SeekerGui)ClientOrchestration.SeekerGuiComponent=ClientOrchestration.Roact.mount(t,ClientOrchestration.playerGui,"\083\099\101\110\101\083\101\101\107\101\114")end if not t and ClientOrchestration.SeekerGuiComponent then if ClientOrchestration.SeekerGuiComponent then ClientOrchestration.Roact.unmount(ClientOrchestration.SeekerGuiComponent)ClientOrchestration.SeekerGuiComponent=nil end end end ClientOrchestration.ClientSceneMetadataRequestConnection=nil ClientOrchestration.setupSchema=function()ClientOrchestration.isSeekable=false local t=ClientOrchestration.lastCalledOrchestrationTime local s,P=ClientOrchestration.SchemaProcessorInstance:Setup()local G=t==ClientOrchestration.lastCalledOrchestrationTime if not s then ClientOrchestration._warn("\067\108\105\101\110\116 \083\099\104\101\109\097 \083\101\116\117\112 \119\097\115\110\'\116 \115\117\099\099\101\115\115\102\117\108")ClientOrchestration._warn(P)elseif G then ClientOrchestration.isSeekable=true end return s end ClientOrchestration.processSchema=function()local t,s=ClientOrchestration.SchemaProcessorInstance:Process()if not t then ClientOrchestration._warn("\067\108\105\101\110\116 \083\099\104\101\109\097 \080\114\111\099\101\115\115 \119\097\115\110\'\116 \115\117\099\099\101\115\115\102\117\108")ClientOrchestration._warn(s)end end ClientOrchestration.cleanUp=function()if ClientOrchestration.SchemaProcessorInstance then ClientOrchestration.SchemaProcessorInstance:CleanUp()end end ClientOrchestration.handleSceneEnded=function()if ClientOrchestration.SchemaProcessorInstance then local t,s=ClientOrchestration.SchemaProcessorInstance:EndScene()if not t then ClientOrchestration._warn("\067\108\105\101\110\116 \069\110\100 \083\099\101\110\101 \119\097\115\110\'\116 \115\117\099\099\101\115\115\102\117\108")ClientOrchestration._warn(s)end ClientOrchestration.cleanUp()end end
-- Events
ClientOrchestration.ClientSceneMetadataEvent = Orchestra.Events.ClientEvents.ClientSceneMetadata
ClientOrchestration.SendMediaControllerConfig = Orchestra.Events.MediaControllerConfigEvents.SendMediaControllerConfig
ClientOrchestration.Seek = Orchestra.Events.ClientEvents.Seek
ClientOrchestration.SceneEnded = Orchestra.Events.ClientEvents.SceneEnded
ClientOrchestration.SeekPermissionsEvent = Orchestra.Events.ClientEvents.SeekPermissions

ClientOrchestration.SeekerGuiComponent = nil

ClientOrchestration.playerGui = Players.LocalPlayer:WaitForChild("PlayerGui")

ClientOrchestration.taskLib = task
ClientOrchestration._warn = function(msg)
	warn(msg)
end

ClientOrchestration._require = function(file)
	return require(file)
end

ClientOrchestration.handleSeekPermissionsEvent = function(hasPermission)
	if hasPermission and not ClientOrchestration.SeekerGuiComponent then
		local SeekerGuiElement = ClientOrchestration.Roact.createElement(ClientOrchestration.SeekerGui)

		ClientOrchestration.SeekerGuiComponent =
			ClientOrchestration.Roact.mount(SeekerGuiElement, ClientOrchestration.playerGui, "SceneSeeker")
	end

	if not hasPermission and ClientOrchestration.SeekerGuiComponent then
		if ClientOrchestration.SeekerGuiComponent then
			ClientOrchestration.Roact.unmount(ClientOrchestration.SeekerGuiComponent)
			ClientOrchestration.SeekerGuiComponent = nil
		end
	end
end

ClientOrchestration.ClientSceneMetadataRequestConnection = nil

ClientOrchestration.setupSchema = function()
	ClientOrchestration.isSeekable = false
	local lastCalledOrchestrationTime = ClientOrchestration.lastCalledOrchestrationTime

	local setupSuccess, setupError = ClientOrchestration.SchemaProcessorInstance:Setup()

	local isSameScene = lastCalledOrchestrationTime == ClientOrchestration.lastCalledOrchestrationTime

	if not setupSuccess then
		ClientOrchestration._warn("Client Schema Setup wasn't successful")
		ClientOrchestration._warn(setupError)
	elseif isSameScene then
		ClientOrchestration.isSeekable = true
	end
	return setupSuccess
end

ClientOrchestration.processSchema = function()
	local processSuccess, processError = ClientOrchestration.SchemaProcessorInstance:Process()

	if not processSuccess then
		ClientOrchestration._warn("Client Schema Process wasn't successful")
		ClientOrchestration._warn(processError)
	end
end

ClientOrchestration.cleanUp = function()
	if ClientOrchestration.SchemaProcessorInstance then
		ClientOrchestration.SchemaProcessorInstance:CleanUp()
	end
end

ClientOrchestration.handleSceneEnded = function()
	if ClientOrchestration.SchemaProcessorInstance then
		local endSceneSuccess, endSceneError = ClientOrchestration.SchemaProcessorInstance:EndScene()
		if not endSceneSuccess then
			ClientOrchestration._warn("Client End Scene wasn't successful")
			ClientOrchestration._warn(endSceneError)
		end
		ClientOrchestration.cleanUp()
	end
end
