-- Compiled with roblox-ts v1.2.7 local TS = _G[script] local t = TS.import(script, TS.getModule(script, "@rbxts", "t").lib.ts) local Lazy = TS.import(script, script.Parent, "Shared", "Lazy") local TSRequire = TS.import(script, script.Parent, "Shared", "tsImportShim") local IS_SERVER = game:GetService("RunService"):IsServer() local HasDependencyInjection = t.interface({ dependencies = t.array(t.string), LoadDependencies = t.callback, }) local serviceMap = {} local serviceLoading = {} local function GetServiceInt(service, importingFrom) if serviceLoading[service] ~= nil then error("Cyclic service dependency " .. (tostring(importingFrom) .. ("<->" .. service))) end local svcImport = serviceMap[service] if svcImport == nil then -- ▼ Set.add ▼ serviceLoading[service] = true -- ▲ Set.add ▲ -- eslint-disable-next-line @typescript-eslint/no-var-requires -- const serviceMaster = require(script.FindFirstChild(service) as ModuleScript) as Map; local serviceMaster = TSRequire(script, service) local importId = IS_SERVER and "Zircon" .. service or "Zircon" .. service svcImport = serviceMaster[importId] if svcImport == nil then error("Tried importing service: " .. (service .. (", but no matching " .. (importId .. " declaration.")))) end local _svcImport = svcImport -- ▼ Map.set ▼ serviceMap[service] = _svcImport -- ▲ Map.set ▲ if HasDependencyInjection(svcImport) then local dependencies = {} for _, dependency in ipairs(svcImport.dependencies) do local _arg0 = Lazy(function() return GetServiceInt(dependency, service) end) -- ▼ Array.push ▼ dependencies[#dependencies + 1] = _arg0 -- ▲ Array.push ▲ end svcImport.LoadDependencies(unpack(dependencies)) end -- ▼ Set.delete ▼ serviceLoading[service] = nil -- ▲ Set.delete ▲ return svcImport else return svcImport end end --[[ * * Synchronously imports the service * @rbxts server * @internal * @param service The service name ]] local function GetCommandService(service) return GetServiceInt(service) end return { GetCommandService = GetCommandService, }