-- Compiled with roblox-ts v1.2.7 local TS = _G[script] local LogLevel = TS.import(script, TS.getModule(script, "@rbxts", "log").out).LogLevel local ZirconClientStore = TS.import(script, script.Parent.Parent, "Client", "BuiltInConsole", "Store").default local ZirconClient = TS.import(script, script.Parent.Parent).ZirconClient local GetCommandService = TS.import(script, script.Parent).GetCommandService local ZirconDebug = TS.import(script, script.Parent.Parent, "Shared", "Debugging").ZirconDebug local Remotes = TS.import(script, script.Parent.Parent, "Shared", "Remotes").default local DispatchContext do local _inverse = {} DispatchContext = setmetatable({}, { __index = _inverse, }) DispatchContext.Server = 0 _inverse[0] = "Server" DispatchContext.Client = 1 _inverse[1] = "Client" end local ZirconClientDispatchService = {} do local _container = ZirconClientDispatchService local Registry -- * @internal local dependencies = { "ClientRegistryService" } _container.dependencies = dependencies local DispatchToServer = Remotes.Client:WaitFor("ZrSiO4/DispatchToServer"):expect() local function Dispatch(input) DispatchToServer:SendToServer(input) end _container.Dispatch = Dispatch local function Log(data) ZirconClientStore:dispatch({ type = "AddOutput", message = { type = "slog:output", data = data, context = 1, }, }) end -- * @internal local ExecuteScript = TS.async(function(text) local Registry = GetCommandService("ClientRegistryService") local _exp = TS.Promise.defer(function(resolve, reject) local mainScript = Registry.GetScriptContextsForLocalPlayer() local source = mainScript:parseSource(text, 1001, "command") if source:isOk() then resolve(mainScript:createScript(source.okValue)) else reject(source:unwrapErr().errors) end end) local _arg0 = function(scr) return scr:execute() end local _exp_1 = _exp:andThen(_arg0) local _arg0_1 = function(output) local _arg0_2 = function(message) Log({ Template = (string.gsub(message, "{(.-)}", "{{%1}}")), Timestamp = DateTime.now():ToIsoDate(), Level = LogLevel.Information, SourceContext = "Client Script", }) end -- ▼ ReadonlyArray.forEach ▼ for _k, _v in ipairs(output) do _arg0_2(_v, _k - 1, output) end -- ▲ ReadonlyArray.forEach ▲ end return _exp_1:andThen(_arg0_1):catch(function(err) if type(err) == "table" then local messages = err for _, message in ipairs(messages) do local errMsg = ZirconDebug.GetMessageForError(text, message) ZirconClient.ZirconErrorLog(errMsg) end end end) end) _container.ExecuteScript = ExecuteScript end return { DispatchContext = DispatchContext, ZirconClientDispatchService = ZirconClientDispatchService, }