{"version":3,"file":"typedi.without-new-config.min.mjs","sources":["../esm5/utils/throw-error.util.js","../esm5/container-registry.class.js","../esm5/token.class.js","../esm5/error/service-not-found.error.js","../esm5/error/cannot-instantiate-value.error.js","../esm5/constants/empty.const.js","../esm5/constants/builtins.const.js","../esm5/error/cannot-instantiate-builtin-error.js","../esm5/constants/service-defaults.const.js","../esm5/constants/type-stamps.const.js","../esm5/utils/resolve-to-type-wrapper.util.js","../esm5/utils/is-inject-identifier.util.js","../esm5/utils/is-lazy-reference.util.js","../esm5/utils/wrap-resolvable-dependency.js","../esm5/constants/host-container.const.js","../esm5/container-instance.class.js","../esm5/utils/format-class-name.js","../esm5/decorators/service.decorator.js","../esm5/decorators/js-service.decorator.js","../esm5/functions/host-container.function.js","../esm5/functions/lazy.function.js","../esm5/functions/resolution-constraints.functions.js","../esm5/index.js"],"sourcesContent":["export function throwError(error) {\n    throw error;\n}\n//# sourceMappingURL=throw-error.util.js.map","import { ContainerInstance } from './container-instance.class';\nimport { throwError } from './utils/throw-error.util';\n/**\n * The container registry is responsible for holding the default and every\n * created container instance for later access.\n *\n * _Note: This class is for internal use and its API may break in minor or\n * patch releases without warning._\n */\nexport class ContainerRegistry {\n    /**\n     * Registers the given container instance or throws an error.\n     *\n     * _Note: This function is auto-called when a Container instance is created,\n     * it doesn't need to be called manually!_\n     *\n     * @param container the container to add to the registry\n     */\n    static registerContainer(container) {\n        if (container instanceof ContainerInstance === false) {\n            // TODO: Create custom error for this.\n            throwError(new Error('Only ContainerInstance instances can be registered.'));\n        }\n        if (ContainerRegistry.containerMap.has(container.id)) {\n            // TODO: Create custom error for this.\n            throwError(new Error('Cannot register container with same ID.'));\n        }\n        ContainerRegistry.containerMap.set(container.id, container);\n    }\n    /**\n     * Returns true if a container exists with the given ID or false otherwise.\n     *\n     * @param container the ID of the container\n     */\n    static hasContainer(id) {\n        return ContainerRegistry.containerMap.has(id);\n    }\n    /**\n     * Returns the container for requested ID or throws an error if no container\n     * is registered with the given ID.\n     *\n     * @param container the ID of the container\n     */\n    static getContainer(id) {\n        const registeredContainer = this.containerMap.get(id);\n        if (registeredContainer === undefined) {\n            // TODO: Create custom error for this.\n            throwError(new Error('No container is registered with the given ID.'));\n        }\n        return registeredContainer;\n    }\n    /**\n     * Removes the given container from the registry and disposes all services\n     * registered only in this container.\n     *\n     * This function throws an error if no\n     *   - container exists with the given ID\n     *   - any of the registered services threw an error during it's disposal\n     *\n     * @param container the container to remove from the registry\n     */\n    static async removeContainer(container) {\n        const registeredContainer = ContainerRegistry.containerMap.get(container.id);\n        if (registeredContainer === undefined) {\n            // TODO: Create custom error for this.\n            throwError(new Error('No container is registered with the given ID.'));\n        }\n        /** We remove the container first. */\n        ContainerRegistry.containerMap.delete(container.id);\n        /** We dispose all registered classes in the container. */\n        await registeredContainer.dispose();\n    }\n}\n/**\n * The list of all known container. Created containers are automatically added\n * to this list. Two container cannot be registered with the same ID.\n *\n * This map doesn't contains the default container.\n */\nContainerRegistry.containerMap = new Map();\n//# sourceMappingURL=container-registry.class.js.map","/**\n * Used to create unique typed service identifier.\n * Useful when service has only interface, but don't have a class.\n */\n/* eslint-disable-next-line @typescript-eslint/no-unused-vars */\nexport class Token {\n    /**\n     * @param name Token name, optional and only used for debugging purposes.\n     */\n    constructor(name) {\n        this.name = name;\n    }\n}\n//# sourceMappingURL=token.class.js.map","import { Token } from '../token.class';\n/**\n * Thrown when requested service was not found.\n */\nexport class ServiceNotFoundError extends Error {\n    get message() {\n        return (`Service with \"${this.normalizedIdentifier}\" identifier was not found in the container. ` +\n            `Register it before usage via explicitly calling the \"Container.set\" function or using the \"@Service()\" decorator.`);\n    }\n    constructor(identifier) {\n        super();\n        this.name = 'ServiceNotFoundError';\n        /** Normalized identifier name used in the error message. */\n        this.normalizedIdentifier = '<UNKNOWN_IDENTIFIER>';\n        if (typeof identifier === 'string') {\n            this.normalizedIdentifier = identifier;\n        }\n        else if (identifier instanceof Token) {\n            this.normalizedIdentifier = `Token<${identifier.name || 'UNSET_NAME'}>`;\n        }\n        else if (identifier && (identifier.name || identifier.prototype?.name)) {\n            this.normalizedIdentifier =\n                `MaybeConstructable<${identifier.name ?? identifier.prototype?.name}>`;\n        }\n    }\n}\n//# sourceMappingURL=service-not-found.error.js.map","import { Token } from '../token.class';\n/**\n * Thrown when DI cannot inject value into property decorated by `@Inject` decorator.\n */\nexport class CannotInstantiateValueError extends Error {\n    get message() {\n        return (`Cannot instantiate the requested value for the \"${this.normalizedIdentifier}\" identifier. ` +\n            `The related metadata doesn't contain a factory or a type to instantiate.`);\n    }\n    constructor(identifier) {\n        super();\n        this.name = 'CannotInstantiateValueError';\n        /** Normalized identifier name used in the error message. */\n        this.normalizedIdentifier = '<UNKNOWN_IDENTIFIER>';\n        // TODO: Extract this to a helper function and share between this and NotFoundError.\n        if (typeof identifier === 'string') {\n            this.normalizedIdentifier = identifier;\n        }\n        else if (identifier instanceof Token) {\n            this.normalizedIdentifier = `Token<${identifier.name || 'UNSET_NAME'}>`;\n        }\n        else if (identifier && (identifier.name || identifier.prototype?.name)) {\n            this.normalizedIdentifier =\n                `MaybeConstructable<${identifier.name}>` ||\n                    `MaybeConstructable<${identifier.prototype?.name}>`;\n        }\n    }\n}\n//# sourceMappingURL=cannot-instantiate-value.error.js.map","/**\n * Indicates that a service has not been initialized yet.\n *\n * _Note: This value is for internal use only._\n */\nexport const EMPTY_VALUE = Symbol('EMPTY_VALUE');\n//# sourceMappingURL=empty.const.js.map","export const BUILT_INS = [String, Object, Boolean, Symbol, Array, Number];\n//# sourceMappingURL=builtins.const.js.map","import { CannotInstantiateValueError } from './cannot-instantiate-value.error';\n/**\n * Thrown when DI encounters a service depending on a built-in type (Number, String) with no factory.\n */\nexport class CannotInstantiateBuiltInError extends CannotInstantiateValueError {\n    get message() {\n        return super.message + ` If your service requires built-in or unresolvable types, please use a factory.`;\n    }\n}\n//# sourceMappingURL=cannot-instantiate-builtin-error.js.map","import { EMPTY_VALUE } from './empty.const';\n/**\n * An object containing default values for services.\n * This can then be merged in to passed-in services\n * to provide them with default configuration where\n * an option has not been explicitly specified.\n */\nexport const SERVICE_METADATA_DEFAULTS = {\n    multiple: false,\n    eager: false,\n    scope: 'container',\n    value: EMPTY_VALUE,\n    factory: undefined,\n};\n//# sourceMappingURL=service-defaults.const.js.map","/**\n * A stamp signifying that an object is a `LazyReference`.\n *\n * _Note: This value is for internal use only._\n */\nexport const LAZY_REFERENCE = Symbol('LAZY_REFERENCE');\n/**\n * A stamp signifying that an object is a `InjectedFactory`.\n *\n * _Note: This value is for internal use only._\n */\nexport const INJECTED_FACTORY = Symbol('INJECTED_FACTORY');\n//# sourceMappingURL=type-stamps.const.js.map","import { Token } from '../token.class';\nimport { isInjectedFactory } from './is-inject-identifier.util';\nimport { isLazyReference } from './is-lazy-reference.util';\n/**\n * Helper function used in the injection-related decorators to resolve the received identifier to\n * an eager type when possible or to a lazy type when cyclic dependencies are possibly involved.\n *\n * @param typeOrIdentifier a service identifier or a function returning a type acting as service identifier or nothing\n * @param target the class definition of the target of the decorator\n */\nexport function resolveToTypeWrapper(typeOrIdentifier) {\n    /**\n     * ? We want to error out as soon as possible when looking up services to inject, however\n     * ? we cannot determine the type at decorator execution when cyclic dependencies are involved\n     * ? because calling the received `() => MyType` function right away would cause a JS error:\n     * ? \"Cannot access 'MyType' before initialization\", so we need to execute the function in the handler,\n     * ? when the classes are already created. To overcome this, we use a wrapper:\n     * ?  - the lazyType is executed in the handler so we never have a JS error\n     * ?  - the eagerType is checked when decorator is running and an error is raised if an unknown type is encountered\n     */\n    let typeWrapper;\n    /** If requested type is explicitly set via a string ID or token, we set it explicitly. */\n    if (typeOrIdentifier &&\n        (typeof typeOrIdentifier === 'string' ||\n            typeOrIdentifier instanceof Token ||\n            typeof typeOrIdentifier === 'function')) {\n        typeWrapper = { eagerType: typeOrIdentifier, lazyType: () => typeOrIdentifier, isFactory: false };\n    }\n    else if (typeof typeOrIdentifier === 'object' && isInjectedFactory(typeOrIdentifier)) {\n        /** If requested type is an injected factory, we set it explicitly. */\n        typeWrapper = { eagerType: null, factory: typeOrIdentifier, isFactory: true };\n    }\n    else if (typeOrIdentifier && isLazyReference(typeOrIdentifier)) {\n        /** If requested type is explicitly set via a LazyReference, we set it explicitly. */\n        /** We set eagerType to null, preventing the raising of the CannotInjectValueError in decorators.  */\n        typeWrapper = { eagerType: null, lazyType: () => typeOrIdentifier.get(), isFactory: false };\n    }\n    return typeWrapper;\n}\n//# sourceMappingURL=resolve-to-type-wrapper.util.js.map","import { INJECTED_FACTORY } from '../constants/type-stamps.const';\n/** Check if the specified object is an InjectedFactory. */\nexport function isInjectedFactory(x) {\n    return x[INJECTED_FACTORY] === true;\n}\n//# sourceMappingURL=is-inject-identifier.util.js.map","import { LAZY_REFERENCE } from '../constants/type-stamps.const';\nexport function isLazyReference(x) {\n    return x[LAZY_REFERENCE] === true;\n}\n//# sourceMappingURL=is-lazy-reference.util.js.map","import { resolveToTypeWrapper } from './resolve-to-type-wrapper.util';\nimport { throwError } from './throw-error.util';\nexport function wrapDependencyAsResolvable(dependency) {\n    let constraints;\n    let typeWrapper;\n    if (Array.isArray(dependency)) {\n        /** The dependency is a [ID, options] pair. Let's parse it as such. */\n        const [id, options] = dependency;\n        /** Perform some very basic sanity checking on the pair. */\n        if (id == null || options == null) {\n            // TODO: make this more descriptive\n            throwError(new Error('The dependency pair was not instantiated correctly.'));\n        }\n        if (typeof options === 'number') {\n            constraints = options;\n        }\n        typeWrapper = resolveToTypeWrapper(id);\n    }\n    else {\n        /** The dependency is an injectable identifier. */\n        typeWrapper = resolveToTypeWrapper(dependency);\n    }\n    return {\n        constraints,\n        typeWrapper,\n    };\n}\n//# sourceMappingURL=wrap-resolvable-dependency.js.map","import { Token } from '../token.class';\n/**\n * A special identifier which can be used to get the container\n * the service is currently being executed under.\n */\nexport const HOST_CONTAINER = new Token('Host Container');\n//# sourceMappingURL=host-container.const.js.map","import { ContainerRegistry } from './container-registry.class';\nimport { ServiceNotFoundError } from './error/service-not-found.error';\nimport { CannotInstantiateValueError } from './error/cannot-instantiate-value.error';\nimport { Token } from './token.class';\nimport { EMPTY_VALUE } from './constants/empty.const';\nimport { BUILT_INS } from './constants/builtins.const';\nimport { CannotInstantiateBuiltInError } from './error/cannot-instantiate-builtin-error';\nimport { SERVICE_METADATA_DEFAULTS } from './constants/service-defaults.const';\nimport { wrapDependencyAsResolvable } from './utils/wrap-resolvable-dependency';\nimport { HOST_CONTAINER } from './constants/host-container.const';\nimport { throwError } from './utils/throw-error.util';\n/**\n * A static variable containing \"throwIfDisposed\".\n *\n * @example\n * ```ts\n * this[THROW_IF_DISPOSED]();\n * ```\n *\n * This is done instead of:\n *\n * ```ts\n * this.throwIfDisposed();\n * ```\n *\n * The former version reduces the bundle size, as the variable name can be mangled safely.\n */\nconst THROW_IF_DISPOSED = 'throwIfDisposed';\n/**\n * A list of IDs which, when passed to `.has`, always return true.\n *\n * This is used to facilitate the implementation of virtual tokens such as\n * HostContainer which are not actually present in the container.\n *\n * In these situations, returning `false` on a .has check would not be spec-compliant,\n * and would expose internal implementation details regarding the container.\n */\nconst ALWAYS_RESOLVABLE = [\n    /**\n     * Provide compatibility with the `HostContainer()` API.\n     */\n    HOST_CONTAINER,\n];\n/**\n * TypeDI can have multiple containers.\n * One container is ContainerInstance.\n */\nexport class ContainerInstance {\n    /**\n     * Create a ContainerInstance.\n     *\n     * @param id The ID of the container to create.\n     * @param parent The parent of the container to create.\n     * The parent is used for resolving identifiers which are\n     * not present in this container.\n     */\n    constructor(id, parent) {\n        this.parent = parent;\n        /** Metadata for all registered services in this container. */\n        this.metadataMap = new Map();\n        /**\n         * Services registered with 'multiple: true' are saved as simple services\n         * with a generated token and the mapping between the original ID and the\n         * generated one is stored here. This is handled like this to allow simplifying\n         * the inner workings of the service instance.\n         */\n        this.multiServiceIds = new Map();\n        /**\n         * Indicates if the container has been disposed or not.\n         * Any function call should fail when called after being disposed.\n         */\n        this.disposed = false;\n        this.id = id;\n    }\n    /**\n     * Checks if the service with given name or type is registered service container.\n     * Optionally, parameters can be passed in case if instance is initialized in the container for the first time.\n     *\n     * If recursive mode is enabled, the symbol is not available locally, and we have a parent,\n     * we tell the parent to search its tree recursively too.\n     * If the container tree is substantial, this operation may affect performance.\n     *\n     * @param identifier The identifier of the service to look up.\n     *\n     * @returns Whether the identifier is present in the current container, or its parent.\n     *\n     * @throws Error\n     * This exception is thrown if the container has been disposed.\n     */\n    has(identifier, recursive = true) {\n        this[THROW_IF_DISPOSED]();\n        if (ALWAYS_RESOLVABLE.includes(identifier)) {\n            return true;\n        }\n        const location = this.getIdentifierLocation(identifier);\n        if (recursive && location === \"parent\" /* ServiceIdentifierLocation.Parent */) {\n            return true;\n        }\n        return location === \"local\" /* ServiceIdentifierLocation.Local */;\n    }\n    /**\n     * Return the location of the given identifier.\n     * If recursive mode is enabled, the symbol is not available locally, and we have a parent,\n     * we tell the parent to search its tree recursively too.\n     * If the container tree is substantial, this operation may affect performance.\n     *\n     * @param identifier The identifier of the service to look up.\n     *\n     * @returns A ServiceIdentifierLocation.\n     *  - If the identifier cannot be found, `ServiceIdentifierLocation.None`.\n     *  - If the identifier is found locally, `ServiceIdentifierLocation.Local`.\n     *  - If the identifier is found upstream, `ServiceIdentifierLocation.Parent.`\n     *\n     * @throws Error\n     * This exception is thrown if the container has been disposed.\n     */\n    getIdentifierLocation(identifier) {\n        this[THROW_IF_DISPOSED]();\n        if (this.metadataMap.has(identifier) || this.multiServiceIds.has(identifier)) {\n            return \"local\" /* ServiceIdentifierLocation.Local */;\n        }\n        // If we have a parent container, see if that has the identifier.\n        // todo: should we always use true here?\n        if (this.parent && this.parent.has(identifier, true)) {\n            return \"parent\" /* ServiceIdentifierLocation.Parent */;\n        }\n        return \"none\" /* ServiceIdentifierLocation.None */;\n    }\n    /**\n     * Get the value for the identifier in the current container.\n     * If the identifier cannot be resolved locally, the parent tree\n     * (if present) is recursively searched until a match is found\n     * (or the tree is exhausted).\n     *\n     * @param identifier The identifier to get the value of.\n     *\n     * @returns The value of the identifier in the current scope.\n     *\n     * @throws ServiceNotFoundError\n     * This exception is thrown if the identifier cannot be found in the tree.\n     *\n     * @throws Error\n     * This exception is thrown if the container has been disposed.\n     */\n    get(identifier, recursive) {\n        const response = this.getOrNull(identifier, recursive);\n        if (response === null) {\n            throwError(new ServiceNotFoundError(identifier));\n        }\n        return response;\n    }\n    /**\n     * Resolve the metadata for the given identifier.  Returns null if no metadata could be found.\n     *\n     * @param identifier The identifier to resolve metadata for.\n     * @param recursive Whether the lookup operation is recursive.\n     *\n     * @returns\n     * If the identifier is found, a tuple is returned consisting of the following:\n     *   1. The metadata for the given identifier, if found.\n     *   2. The location from where the metadata was returned.\n     *   `ServiceIdentifierLocation.Parent` is returned if the identifier was found upstream.\n     *\n     * If an identifier cannot be found, `null` is returned.\n     *\n     * @throws Error\n     * This exception is thrown if the container has been disposed.\n     */\n    resolveMetadata(identifier, recursive) {\n        this[THROW_IF_DISPOSED]();\n        /**\n         * Firstly, ascertain the location of the identifier.\n         * If it is located on the parent, we shall yield to the parent's .get.\n         */\n        const location = this.getIdentifierLocation(identifier);\n        switch (location) {\n            case \"none\" /* ServiceIdentifierLocation.None */:\n                return null;\n            case \"local\" /* ServiceIdentifierLocation.Local */:\n                return [this.metadataMap.get(identifier), location];\n            case \"parent\" /* ServiceIdentifierLocation.Parent */:\n                /** Don't perform any parent lookups if we're not recursively scanning the tree. */\n                if (recursive) {\n                    /**\n                     * Unpack the possibly-resolved metadata object from the parent.\n                     * We don't directly return the parent's resolveMetadata call here as that would\n                     * return \"ServiceIdentifierLocation.Local\" if it was resolved on the parent.\n                     */\n                    const possibleResolution = this.parent?.resolveMetadata(identifier, true);\n                    return possibleResolution ? [possibleResolution[0], \"parent\" /* ServiceIdentifierLocation.Parent */] : null;\n                }\n                return null;\n        }\n    }\n    /**\n     * Retrieves the service with given name or type from the service container.\n     * Optionally, parameters can be passed in case if instance is initialized in the container for the first time.\n     *\n     * To preserve compatibility with TypeDI, recursive is set to false by default.\n     *\n     * @param identifier The identifier to get the value of.\n     *\n     * @returns The resolved value for the given metadata, or `null` if it could not be found.\n     *\n     * @throws Error\n     * This exception is thrown if the container has been disposed.\n     */\n    getOrNull(identifier, recursive = true) {\n        this[THROW_IF_DISPOSED]();\n        /**\n         * Provide compatibility with the `HostContainer()` API.\n         */\n        if (identifier === HOST_CONTAINER) {\n            return this;\n        }\n        const maybeResolvedMetadata = this.resolveMetadata(identifier, recursive);\n        if (maybeResolvedMetadata === null) {\n            return null;\n        }\n        /**\n         * At this point, we have narrowed the location of the identifier\n         * down to ServiceIdentifierLocation.Local.\n         * Therefore, the symbol exists locally.\n         *\n         * To preserve compatibility with TypeDI, if the identifier exists on\n         * the parent but not locally, we still treat it as if it were resolved locally.\n         */\n        const [baseMetadata, location] = maybeResolvedMetadata;\n        const isUpstreamMetadata = location === \"parent\" /* ServiceIdentifierLocation.Parent */;\n        /**\n         * To preserve compatibility with TypeDI, if the identifier metadata was loaded\n         * from the parent, we then import it into this container.\n         * The objects are also cloned to prevent mutations from affecting this instance.\n         * <https://github.com/typestack/typedi/blob/8da3ef286299bca6bd7ddf4082268f422f700630/src/container-instance.class.ts#L94>\n         */\n        if (isUpstreamMetadata) {\n            let value;\n            /**\n             * If the type cannot be reconstructed  (i.e. it's a static value, possibly set via\n             * {@link ContainerInstance.setValue}), do not erase the type in the new metadata.\n             *\n             * Furthermore, do not erase the value if the imported service is a singleton.\n             * This mirrors the behaviour of the prior implementation.\n             */\n            const isReconstructable = baseMetadata.factory != null || baseMetadata.type != null;\n            if (!isReconstructable || baseMetadata.scope === 'singleton') {\n                value = baseMetadata.value;\n            }\n            else {\n                value = EMPTY_VALUE;\n            }\n            const newServiceMetadata = {\n                ...baseMetadata,\n                /**\n                 * If the service is a singleton, we'll import its value directly into this container.\n                 * Otherwise, we set the value to the well-known placeholder.\n                 */\n                value,\n            };\n            /**\n             * If the service is a singleton, return it directly from the global container.\n             * We can safely assume it exists there.\n             */\n            if (newServiceMetadata.scope === 'singleton') {\n                return ContainerInstance.defaultContainer.getOrNull(identifier, recursive);\n            }\n            /**\n             * If it's not a singleton, import it into the current container,\n             * and then recursively call .getOrNull which takes the local path\n             * instead of dealing with upstream metadata.\n             */\n            const newServiceID = this.set(newServiceMetadata, [...baseMetadata.dependencies]);\n            return this.getOrNull(newServiceID, recursive);\n        }\n        let metadata = baseMetadata;\n        /** Firstly, we shall check if the service is a singleton.  If it is, load it from the global registry. */\n        if (baseMetadata?.scope === 'singleton') {\n            metadata = ContainerInstance.defaultContainer.metadataMap.get(identifier);\n        }\n        /** This should never happen as multi services are masked with custom token in Container.set. */\n        if (metadata && metadata.multiple === true) {\n            /* istanbul ignore next */\n            throwError(new Error(`Cannot resolve multiple values for ${identifier.toString()} service!`));\n        }\n        /** Otherwise it's returned from the current / parent container. */\n        if (metadata) {\n            return this.getServiceValue(metadata);\n        }\n        return null;\n    }\n    /**\n     * Gets all instances registered in the container of the given service identifier.\n     * Used when service defined with multiple: true flag.\n     *\n     * @param identifier The identifier to resolve.\n     *\n     * @returns An array containing the service instances for the given\n     * identifier.\n     *\n     * @throws ServiceNotFoundError\n     * This exception is thrown if a value could not be found for the given identifier.\n     *\n     * @throws Error\n     * This exception is thrown if the container has been disposed.\n     */\n    getMany(identifier, recursive) {\n        const response = this.getManyOrNull(identifier, recursive);\n        if (response === null) {\n            throwError(new ServiceNotFoundError(identifier));\n        }\n        return response;\n    }\n    /**\n     * Gets all instances registered in the container of the given service identifier.\n     * Used when service defined with multiple: true flag.\n     *\n     * @param identifier The identifier to resolve.\n     *\n     * @returns An array containing the service instances for the given identifier.\n     * If none can be found, `null` is returned.\n     *\n     * @throws Error\n     * This exception is thrown if the container has been disposed.\n     */\n    getManyOrNull(identifier, recursive = true) {\n        this[THROW_IF_DISPOSED]();\n        let idMap = undefined;\n        if (!this.multiServiceIds.has(identifier)) {\n            /** If this container has no knowledge of the identifier, then we check the parent (if we have one). */\n            if (recursive && this.parent && this.parent.multiServiceIds.has(identifier)) {\n                /** It looks like it does! Let's use that instead. */\n                idMap = this.parent.multiServiceIds.get(identifier);\n            }\n        }\n        else {\n            idMap = this.multiServiceIds.get(identifier);\n        }\n        /** If no IDs could be found, return null. */\n        if (!idMap) {\n            return null;\n        }\n        /**\n         * If the service is registered as a singleton, we load it from the global container.\n         * Otherwise, the local registry is used.\n         */\n        const subject = idMap.scope === 'singleton'\n            ? (generatedId) => ContainerInstance.defaultContainer.get(generatedId)\n            : (generatedId) => this.get(generatedId, recursive);\n        return idMap.tokens.map(subject);\n    }\n    set(serviceOptions, precompiledDependencies) {\n        this.throwIfDisposed();\n        /**\n         * If the service is marked as singleton, we set it in the default container.\n         * (And avoid an infinite loop via checking if we are in the default container or not.)\n         */\n        if (serviceOptions['scope'] === 'singleton' && ContainerInstance.defaultContainer !== this) {\n            /**\n             * 1. The (as any) cast above is for performance: why bother putting the arguments\n             * together if we can very quickly determine if the argument is of type object?\n             * If we did this return below, we'd be wasting a newly-constructed object, PLUS\n             * a few function calls to helpers like resolveToTypeWrapper.\n             *\n             * 2. Below, we trick TypeScript into thinking we're using the 1st overload here.\n             * However, we haven't actually checked the types of each argument.\n             * This is, of course, left to ContainerInstance#set.\n             */\n            // todo: should we really be binding to defaultContainer here?\n            return ContainerInstance.defaultContainer.set(serviceOptions, precompiledDependencies);\n        }\n        /**\n         * The dependencies of the object are either delivered in a pre-compiled list of TypeWrapper objects (from @Service),\n         * or from the dependencies list of the service options object, which must then be compiled to a list of type wrappers.\n         */\n        const dependencies = precompiledDependencies ??\n            serviceOptions?.dependencies?.map(wrapDependencyAsResolvable) ??\n            [];\n        const newMetadata = {\n            /**\n             * Typescript cannot understand that if ID doesn't exists then type must exists based on the\n             * typing so we need to explicitly cast this to a `ServiceIdentifier`\n             */\n            id: (serviceOptions.id ?? serviceOptions.type),\n            type: null,\n            ...SERVICE_METADATA_DEFAULTS,\n            /** We allow overriding the above options via the received config object. */\n            ...serviceOptions,\n            // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n            /**\n             * We override the service options with the provided dependencies here, as if we have type wrapped\n             * dependencies only, we'll obviously want to overwrite anything in the options with those.\n             * Additionally, this fixes test cases such as #151.\n             */\n            /** @ts-ignore TypeScript is actually broken here. We've told it dependencies is of type TypeWrapper[], but it still doesn't like it? */\n            dependencies: dependencies,\n        };\n        /** If the incoming metadata is marked as multiple we mask the ID and continue saving as single value. */\n        if (newMetadata.multiple) {\n            const maskedToken = new Token(`MultiMaskToken-${newMetadata.id.toString()}`);\n            const existingMultiGroup = this.multiServiceIds.get(newMetadata.id);\n            if (existingMultiGroup) {\n                existingMultiGroup.tokens.push(maskedToken);\n            }\n            else {\n                this.multiServiceIds.set(newMetadata.id, { scope: newMetadata.scope, tokens: [maskedToken] });\n            }\n            /**\n             * We mask the original metadata with this generated ID, mark the service\n             * as  and continue multiple: false and continue. Marking it as\n             * non-multiple is important otherwise Container.get would refuse to\n             * resolve the value.\n             */\n            newMetadata.id = maskedToken;\n            newMetadata.multiple = false;\n        }\n        // todo: sort this out\n        // I've removed the legacy \"extend service if it already exists\"\n        // behaviour for now.\n        // const existingMetadata = this.metadataMap.get(newMetadata.id);\n        /** This service hasn't been registered yet, so we register it. */\n        this.metadataMap.set(newMetadata.id, newMetadata);\n        /**\n         * If the service is eager, we need to create an instance immediately except\n         * when the service is also marked as transient. In that case we ignore\n         * the eager flag to prevent creating a service what cannot be disposed later.\n         */\n        if (newMetadata.eager && newMetadata.scope !== 'transient') {\n            this.get(newMetadata.id);\n        }\n        return newMetadata.id;\n    }\n    /**\n     * Add a value to the container.\n     *\n     * @param id The ID of the new value to set inside the container.\n     * Must be either a string or a Token.\n     *\n     * @param value The value to set the ID to.\n     *\n     * @returns The identifier of the given service in the container.\n     * This can then be passed to `.get` to resolve the identifier.\n     */\n    setValue(id, value) {\n        if (typeof id !== 'string' && !(id instanceof Token)) {\n            throwError(new Error('The ID passed to setValue must either be a string or a Token.'));\n        }\n        return this.set({ id, value }, []);\n    }\n    /**\n     * Removes services with the given list of service identifiers.\n     *\n     * @param identifierOrIdentifierArray The list of service identifiers to remove from the container.\n     *\n     * @returns The current `ContainerInstance` instance.\n     *\n     * @throws Error\n     * This exception is thrown if the container has been disposed.\n     */\n    remove(identifierOrIdentifierArray) {\n        this[THROW_IF_DISPOSED]();\n        if (Array.isArray(identifierOrIdentifierArray)) {\n            identifierOrIdentifierArray.forEach(id => this.remove(id));\n        }\n        else {\n            const serviceMetadata = this.metadataMap.get(identifierOrIdentifierArray);\n            if (serviceMetadata) {\n                this.disposeServiceInstance(serviceMetadata);\n                this.metadataMap.delete(identifierOrIdentifierArray);\n            }\n        }\n        return this;\n    }\n    /**\n     * Gets a separate container instance for the given instance id.\n     * Optionally, a parent can be passed, which will act as an upstream resolver for the container.\n     *\n     * @param containerId The ID of the container to resolve or create.  Defaults to \"default\".\n     * @param parent The parent of the container, or null to explicitly signal that one should not be provided.  Defaults to the default container.\n     *\n     * @returns The newly-created ContainerInstance, or the pre-existing container with the same name\n     * if one already exists.\n     */\n    static of(containerId = 'default', parent = ContainerInstance.defaultContainer) {\n        if (containerId === 'default') {\n            return this.defaultContainer;\n        }\n        // todo: test parent= default arg\n        let container;\n        if (ContainerRegistry.hasContainer(containerId)) {\n            container = ContainerRegistry.getContainer(containerId);\n        }\n        else {\n            /**\n             * This is deprecated functionality, for now we create the container if it's doesn't exists.\n             * This will be reworked when container inheritance is reworked.\n             */\n            container = new ContainerInstance(containerId, parent ?? undefined);\n            // todo: move this into ContainerInstance ctor\n            ContainerRegistry.registerContainer(container);\n        }\n        return container;\n    }\n    /**\n     * Gets a separate container instance for the given instance id.\n     *\n     * @param containerId The ID of the container to resolve or create.  Defaults to \"default\".\n     *\n     * @example\n     * ```\n     * const newContainer = Container.of('foo');\n     *\n     * @Service({ container: newContainer }, [])\n     * class MyService {}\n     * ```\n     *\n     * @returns The newly-created ContainerInstance, or the pre-existing container with the same name\n     * if one already exists.\n     */\n    of(containerId) {\n        // Todo: make this get the constructor at runtime to aid\n        // extension of the class.\n        return ContainerInstance.of(containerId);\n    }\n    /**\n     * Create a registry with the specified ID, with this instance as its parent.\n     *\n     * @param containerId The ID of the container to resolve or create.  Defaults to \"default\".\n     *\n     * @returns The newly-created ContainerInstance, or the pre-existing container with the same name\n     * if one already exists.\n     *\n     * @throws Error\n     * This exception is thrown if the container has been disposed.\n     */\n    ofChild(containerId) {\n        this[THROW_IF_DISPOSED]();\n        return ContainerInstance.of(containerId, this);\n    }\n    /**\n     * Completely resets the container by removing all previously registered services from it.\n     *\n     * @throws Error\n     * This exception is thrown if the container has been disposed.\n     */\n    reset(options = {\n        strategy: \"resetValue\" /* ContainerResetStrategy.ResetValue */,\n    }) {\n        this[THROW_IF_DISPOSED]();\n        switch (options.strategy) {\n            case \"resetValue\" /* ContainerResetStrategy.ResetValue */:\n                this.metadataMap.forEach(service => this.disposeServiceInstance(service));\n                break;\n            case \"resetServices\" /* ContainerResetStrategy.ResetServices */:\n                this.metadataMap.forEach(service => this.disposeServiceInstance(service));\n                this.metadataMap.clear();\n                this.multiServiceIds.clear();\n                break;\n            default:\n                throwError(new Error('Received invalid reset strategy.'));\n        }\n        return this;\n    }\n    /**\n     * Dispose the container, rendering it unable to perform any further injection or storage.\n     *\n     * @example\n     * ```ts\n     * const appContainer = Container.of('app');\n     *\n     * appContainer.dispose().then(\n     *   () => console.log('The container has been disposed.')\n     * );\n     *\n     * appContainer.disposed === true;\n     *\n     * // This will throw an error:\n     * appContainer.get(\n     *   new Token<unknown>('test')\n     * );\n     * ```\n     *\n     * @returns A promise that resolves when the disposal process is complete.\n     *\n     * @throws Error\n     * This exception is thrown if the container has been disposed.\n     */\n    async dispose() {\n        // eslint-disable-next-line @typescript-eslint/require-await\n        this[THROW_IF_DISPOSED]();\n        this.reset({ strategy: 'resetServices' });\n        /** We mark the container as disposed, forbidding any further interaction with it. */\n        this.disposed = true;\n    }\n    throwIfDisposed() {\n        if (this.disposed) {\n            // TODO: Use custom error.\n            throwError(new Error('Cannot use container after it has been disposed.'));\n        }\n    }\n    /**\n     * Gets the value belonging to passed in `ServiceMetadata` instance.\n     *\n     * - if `serviceMetadata.value` is already set it is immediately returned\n     * - otherwise the requested type is resolved to the value saved to `serviceMetadata.value` and returned\n     */\n    getServiceValue(serviceMetadata) {\n        let value = EMPTY_VALUE;\n        /**\n         * The \"serviceMetadata.factory\" property lookup is inlined into a variable here\n         * as its value will never change, and it reduces the final size of the bundle.\n         */\n        const { factory: factoryMeta } = serviceMetadata;\n        /**\n         * If the service value has been set to anything prior to this call we return that value.\n         * NOTE: This part builds on the assumption that transient dependencies has no value set ever.\n         */\n        if (serviceMetadata.value !== EMPTY_VALUE) {\n            return serviceMetadata.value;\n        }\n        /** If both factory and type is missing, we cannot resolve the requested ID. */\n        if (!factoryMeta && !serviceMetadata.type) {\n            throwError(new CannotInstantiateValueError(serviceMetadata.id));\n        }\n        /**\n         * If a factory is defined it takes priority over creating an instance via `new`.\n         * The return value of the factory is not checked, we believe by design that the user knows what he/she is doing.\n         */\n        if (factoryMeta) {\n            /**\n             * If we received the factory in the [Constructable<Factory>, \"functionName\"] format, we need to create the\n             * factory first and then call the specified function on it.\n             */\n            if (Array.isArray(factoryMeta)) {\n                const [factoryServiceId, factoryServiceMethod] = factoryMeta;\n                /** Try to get the factory from TypeDI first, if failed, fall back to simply initiating the class. */\n                const factoryInstance = this.getOrNull(factoryServiceId) ?? new factoryServiceId();\n                value = factoryInstance[factoryServiceMethod](this, serviceMetadata.id);\n            }\n            else {\n                /** If only a simple function was provided we simply call it. */\n                value = factoryMeta(this, serviceMetadata.id);\n            }\n        }\n        /**\n         * If no factory was provided and only then, we create the instance from the type if it was set.\n         */\n        if (!factoryMeta && serviceMetadata.type) {\n            const constructableTargetType = serviceMetadata.type;\n            const parameters = this.getConstructorParameters(serviceMetadata, true);\n            value = new constructableTargetType(...parameters);\n        }\n        /** If this is not a transient service, and we resolved something, then we set it as the value. */\n        if (serviceMetadata.scope !== 'transient' && value !== EMPTY_VALUE) {\n            serviceMetadata.value = value;\n        }\n        if (value === EMPTY_VALUE) {\n            /** This branch should never execute, but better to be safe than sorry. */\n            throwError(new CannotInstantiateValueError(serviceMetadata.id));\n        }\n        return value;\n    }\n    getConstructorParameters({ dependencies }, guardBuiltIns) {\n        /**\n         * Firstly, check if the metadata declares any dependencies.\n         */\n        if (dependencies.length === 0) {\n            return [];\n        }\n        /**\n         * We do not type-check the identifiers array here as we are the only ones\n         * aware of the reflective key.\n         * Therefore, it can be safely assumed that if the key is present, the correct\n         * data will also be present.\n         */\n        return dependencies.map(wrapper => this.resolveResolvable(wrapper));\n    }\n    /**\n     * Resolve a `Resolvable` object in the current container.\n     *\n     * @param resolvable The resolvable to resolve.\n     *\n     * @returns The resolved value of the item.\n     */\n    resolveResolvable(resolvable) {\n        const identifier = this.resolveTypeWrapper(resolvable.typeWrapper);\n        if (resolvable.constraints) {\n            const { constraints } = resolvable;\n            let resolvedIdentifier;\n            /**\n             * For the individual bit flags, we don't care about the return from `&`.\n             * All that matters is that, if it doesn't return 0, the flag is activated.\n             *\n             * Implementation note: as an optimisation, we use double negative to cast\n             * the result to boolean instead of an explicit `Boolean` call here.\n             * To clarify, the \"!!\" does the *exact* same thing as `Boolean`.\n             */\n            const isOptional = !!(constraints & 2 /* ResolutionConstraintFlag.Optional */);\n            const isSkipSelf = !!(constraints & 4 /* ResolutionConstraintFlag.SkipSelf */);\n            const isSelf = !!(constraints & 8 /* ResolutionConstraintFlag.Self */);\n            const isMany = !!(constraints & 1 /* ResolutionConstraintFlag.Many */);\n            /** SkipSelf() and Self() are incompatible. */\n            if (isSkipSelf && isSelf) {\n                throwError(new Error('SkipSelf() and Self() cannot be used at the same time.'));\n            }\n            /** If SkipSelf is declared, make sure we actually *have* a parent. */\n            if (isSkipSelf && !this.parent) {\n                throwError(new Error(`The SkipSelf() flag was enabled, but the subject container does not have a parent.`));\n            }\n            /**\n             * If SkipSelf() is provided, use the parent container for lookups instead.\n             * If not, we use the current container.\n             */\n            const targetContainer = isSkipSelf ? this.parent : this;\n            /** If Self() is used, do not use recursion. */\n            const recursive = !isSelf ?? undefined;\n            /**\n             * Set up some state registers for various flag configurations.\n             */\n            const identifierIsPresent = targetContainer.has(identifier, recursive);\n            /**\n             * Straight away, check if optional was declared.\n             * If it was not and the symbol was not found, throw an error.\n             * However, if it *was*, simply return `null` as expected.\n             */\n            if (!identifierIsPresent) {\n                if (isOptional) {\n                    return null;\n                }\n                throwError(new ServiceNotFoundError(identifier));\n            }\n            if (isMany) {\n                /** If we're in isMany mode, resolve the identifier via `getMany`. */\n                resolvedIdentifier = targetContainer.getMany(identifier, recursive);\n            }\n            else {\n                resolvedIdentifier = targetContainer.get(identifier, recursive);\n            }\n            return resolvedIdentifier;\n        }\n        /** If no constraints were found, fallback to default behaviour. */\n        return this.get(identifier);\n    }\n    resolveTypeWrapper(wrapper, guardBuiltIns = false) {\n        /**\n         * Reminder: The type wrapper is either resolvable to:\n         *   1. An eager type containing the id of the service, or...\n         *   2. A lazy type containing a function that must be called to resolve the id.\n         *\n         * Therefore, if the eager type does not exist, the lazy type should.\n         */\n        /** ESLint removes the cast, which causes a compilation error: */\n        // eslint-disable-next-line\n        const resolved = wrapper.eagerType ?? wrapper.lazyType?.();\n        if (resolved == null) {\n            throwError(new Error(`The wrapped value could not be resolved.`));\n        }\n        if (guardBuiltIns && BUILT_INS.includes(resolved)) {\n            throwError(new CannotInstantiateBuiltInError(resolved?.name ?? resolved));\n        }\n        /**\n         * We also need to search the graph recursively.\n         * This is in-line with prior behaviour, ensuring that services\n         * from upstream containers can be resolved correctly.\n         */\n        return resolved;\n    }\n    /**\n     * Checks if the given service metadata contains a destroyable service instance and destroys it in place. If the service\n     * contains a callable function named `destroy` it is called but not awaited and the return value is ignored..\n     *\n     * @param serviceMetadata the service metadata containing the instance to destroy\n     * @param force when true the service will be always destroyed even if it's cannot be re-created\n     */\n    disposeServiceInstance(serviceMetadata, force = false) {\n        this[THROW_IF_DISPOSED]();\n        /** We reset value only if we can re-create it (aka type or factory exists). */\n        const shouldResetValue = force || !!serviceMetadata.type || !!serviceMetadata.factory;\n        if (shouldResetValue) {\n            /** If we wound a function named destroy we call it without any params. */\n            if (typeof (serviceMetadata?.value)['dispose'] === 'function') {\n                try {\n                    serviceMetadata.value.dispose();\n                }\n                catch (error) {\n                    /** We simply ignore the errors from the destroy function. */\n                }\n            }\n            serviceMetadata.value = EMPTY_VALUE;\n        }\n    }\n    /** Iterate over each service in the container. */\n    [Symbol.iterator]() {\n        return this.metadataMap.entries();\n    }\n}\n/**\n * The default global container. By default services are registered into this\n * container when registered via `Container.set()` or `@Service` decorator.\n */\nContainerInstance.defaultContainer = new ContainerInstance('default');\n/**\n * Register the default container in ContainerRegistry.\n * We don't use `ContainerInstance.of` here we don't need to check\n * if a container with the \"default\" ID already exists: it never will.\n */\nContainerRegistry.registerContainer(ContainerInstance.defaultContainer);\n//# sourceMappingURL=container-instance.class.js.map","export function formatClassName(ctor) {\n    return String(ctor['name'] || ctor);\n}\n//# sourceMappingURL=format-class-name.js.map","import { ContainerInstance } from '../container-instance.class';\nimport { formatClassName } from '../utils/format-class-name';\nimport { SERVICE_METADATA_DEFAULTS } from '../constants/service-defaults.const';\nimport { BUILT_INS } from '../constants/builtins.const';\nimport { CannotInstantiateBuiltInError } from '../error/cannot-instantiate-builtin-error';\nimport { wrapDependencyAsResolvable } from '../utils/wrap-resolvable-dependency';\nimport { throwError } from '../utils/throw-error.util';\nexport function Service(optionsOrDependencies, maybeDependencies) {\n    return targetConstructor => {\n        if (optionsOrDependencies == null || targetConstructor == null) {\n            // todo: more info in these error messages!!!\n            throwError(new Error('The required configuration was not passed.'));\n        }\n        /** A list of dependencies resolved from the arguments provided to the function. */\n        let resolvedDependencies;\n        if (Array.isArray(optionsOrDependencies)) {\n            /**\n             * If our first argument is an array, then the user has not specified any options,\n             * and has instead filled the slot with a list of dependencies.\n             */\n            resolvedDependencies = optionsOrDependencies;\n        }\n        else if (Array.isArray(maybeDependencies)) {\n            resolvedDependencies = maybeDependencies;\n        }\n        else if ('dependencies' in optionsOrDependencies) {\n            /**\n             * The first argument is of type `ServiceOptions<T>` with dependencies.\n             * We can access its \"dependencies\" property and then map the unwrapped types.\n             */\n            resolvedDependencies = optionsOrDependencies.dependencies;\n        }\n        if (!resolvedDependencies) {\n            /** At this point we have exhausted all options, so throw. */\n            throwError(new Error('The dependencies provided were not able to be resolved.'));\n        }\n        const wrappedDependencies = resolvedDependencies.map(wrapDependencyAsResolvable);\n        /**\n         * A default list of options for this service.\n         * These are used when the options are not explicitly provided to the function.\n         * However, if options are passed, these are merged in as defaults.\n         */\n        let metadata = {\n            id: targetConstructor,\n            type: targetConstructor,\n            ...SERVICE_METADATA_DEFAULTS,\n            container: ContainerInstance.defaultContainer,\n        };\n        if (!Array.isArray(optionsOrDependencies)) {\n            metadata = { ...metadata, ...optionsOrDependencies };\n            /**\n             * Remove the decorators from the options forcibly.\n             * Otherwise, our type-wrapped dependencies passed to ContainerInstance.set are ignored.\n             */\n            delete metadata.dependencies;\n        }\n        const { id, container } = metadata;\n        /**\n         * If the target is already registered, `@Service` has been called twice on the same constructor.\n         * Throw an error, as not doing so would raise ambiguity regarding the implementation.\n         * This is most likely user error, as the function should __never__ be called twice.\n         */\n        if (container.has(id) && !metadata.multiple) {\n            throwError(new Error(`@Service() has been called twice upon ${formatClassName(targetConstructor)}, or you have used an ID twice.`));\n        }\n        /**\n         * Check any available eager types immediately, so we can quickly raise an error\n         * if they are invalid, instead of when the service is injected.\n         */\n        wrappedDependencies.forEach(({ typeWrapper }, index) => {\n            const { eagerType } = typeWrapper;\n            if (eagerType !== null) {\n                const type = typeof typeWrapper;\n                if (type !== 'function' && type !== 'object' && type !== 'string') {\n                    throwError(new Error(`The identifier provided at index ${index} for service ${formatClassName(targetConstructor)} is invalid.`));\n                }\n                else if (metadata.factory == null && BUILT_INS.includes(eagerType)) {\n                    /**\n                     * Ensure the service does not contain built-in types (Number, Symbol, Object, etc.)\n                     * without also holding a factory to manually create an instance of the constructor.\n                     */\n                    throwError(new CannotInstantiateBuiltInError(eagerType?.name ?? eagerType));\n                }\n            }\n        });\n        /**\n         * The `.set(Omit<ServiceOptions<unknown>, \"dependencies\">, TypeWrapper[])` overload is used here.\n         * TypeScript downcasts the metadata to the type above.\n         *\n         * By default, this is set to `defaultContainer`.\n         * Therefore, it will be bound to that.\n         */\n        container.set(metadata, wrappedDependencies);\n    };\n}\n//# sourceMappingURL=service.decorator.js.map","import { throwError } from '../utils/throw-error.util';\nimport { Service } from './service.decorator';\nexport function JSService(optionsOrDependencies, dependenciesOrConstructor, maybeConstructor) {\n    let constructor;\n    if (typeof dependenciesOrConstructor === 'function') {\n        // eslint-disable-next-line\n        constructor = dependenciesOrConstructor;\n        Service(optionsOrDependencies)(constructor);\n    }\n    else if (maybeConstructor) {\n        constructor = maybeConstructor;\n        Service(optionsOrDependencies, dependenciesOrConstructor)(constructor);\n    }\n    if (!constructor) {\n        throwError(new Error('The JSService overload was not used correctly.'));\n    }\n    return constructor;\n}\n//# sourceMappingURL=js-service.decorator.js.map","import { HOST_CONTAINER } from '../constants/host-container.const';\n/**\n * A special identifier which can be used to get the container\n * the service is currently being executed under.\n * Optionally, combined with resolution contraints such as SkipSelf,\n * this could be used to attain a reference to parent containers.\n *\n * @example\n * An example of this can be found below:\n * ```ts\n * @Service([\n *   HostContainer()\n * ])\n * export class MyService {\n *   constructor (private container: ContainerInstance) { }\n * }\n * ```\n */\nexport function HostContainer() {\n    return HOST_CONTAINER;\n}\n//# sourceMappingURL=host-container.function.js.map","import { LAZY_REFERENCE } from '../constants/type-stamps.const';\n/**\n * Create a lazy reference to a value.\n * This is typically used to signal to `@InjectAll` that a reference must\n * not be eagerly loaded, e.g. in the case of cyclic dependencies.\n */\nexport function Lazy(fn) {\n    return { get: () => fn(), [LAZY_REFERENCE]: true };\n}\n//# sourceMappingURL=lazy.function.js.map","/**\n * If the identifier cannot be found, substitute it with `null`.\n * @experimental\n *\n * The constraints supported are listed in {@see ResolutionConstraintFlag}.\n *\n * @example\n * This function can be used to construct a bitmask for use\n * in the dependencies array of a service.\n * While this can be used publicly, it is mainly for use\n * within TypeDI; it allows you to configure specific constraints\n * for use when resolving a specific service.\n *\n * ```ts\n * const constraintBitMask = Optional() | Self();\n *\n * if (constraintBitMask & ResolutionConstraintFlag.Optional) {\n *   console.log('The dependency is optional.');\n * }\n * ```\n *\n * @returns The resolution constraint bit-flag for Optional.\n */\nexport function Optional() {\n    return 2 /* ResolutionConstraintFlag.Optional */;\n}\n/**\n * Do not ascend the container tree to resolve this identifier.\n * @experimental\n *\n * The constraints supported are listed in {@see ResolutionConstraintFlag}.\n *\n * @example\n * This function can be used to construct a bitmask for use\n * in the dependencies array of a service.\n * While this can be used publicly, it is mainly for use\n * within TypeDI; it allows you to configure specific constraints\n * for use when resolving a specific service.\n *\n * ```ts\n * const constraintBitMask = Self();\n *\n * if (constraintBitMask & ResolutionConstraintFlag.Self) {\n *   console.log('The dependency will not be resolved recursively.');\n * }\n * ```\n *\n * @returns The resolution constraint bit-flag for Self.\n */\nexport function Self() {\n    return 8 /* ResolutionConstraintFlag.Self */;\n}\n/**\n * Begin searching from the parent container to resolve this identifier.\n * @experimental\n *\n * The constraints supported are listed in {@see ResolutionConstraintFlag}.\n *\n * @example\n * This function can be used to construct a bitmask for use\n * in the dependencies array of a service.\n * While this can be used publicly, it is mainly for use\n * within TypeDI; it allows you to configure specific constraints\n * for use when resolving a specific service.\n *\n * ```ts\n * const constraintBitMask = SkipSelf();\n *\n * if (constraintBitMask & ResolutionConstraintFlag.Self) {\n *   console.log('The dependency will be resolved recursively from the parent.');\n * }\n * ```\n *\n * @returns The resolution constraint bit-flag for SkipSelf.\n */\nexport function SkipSelf() {\n    return 4 /* ResolutionConstraintFlag.SkipSelf */;\n}\n/**\n * Resolve multiple services for this identifier via `getMany`.\n * @experimental\n *\n * The constraints supported are listed in {@see ResolutionConstraintFlag}.\n *\n * @example\n * This function can be used to construct a bitmask for use\n * in the dependencies array of a service.\n * While this can be used publicly, it is mainly for use\n * within TypeDI; it allows you to configure specific constraints\n * for use when resolving a specific service.\n *\n * ```ts\n * const constraintBitMask = Many() | SkipSelf();\n *\n * if (constraintBitMask & ResolutionConstraintFlag.Many) {\n *   console.log('The dependency will be resolved via \"getMany\".');\n * }\n * ```\n *\n * @returns The resolution constraint bit-flag for SkipSelf.\n */\nexport function Many() {\n    return 1 /* ResolutionConstraintFlag.Many */;\n}\n//# sourceMappingURL=resolution-constraints.functions.js.map","/** This is an internal package, so we don't re-export it on purpose. */\nimport { ContainerInstance } from './container-instance.class';\nexport { JSService } from './decorators/js-service.decorator';\nexport { Service } from './decorators/service.decorator';\nexport * from './error/cannot-instantiate-builtin-error';\nexport * from './error/cannot-instantiate-value.error';\nexport * from './error/service-not-found.error';\nexport { HostContainer } from './functions/host-container.function';\nexport { Lazy } from './functions/lazy.function';\nexport { Many, Optional, Self, SkipSelf } from './functions/resolution-constraints.functions';\nexport { ContainerInstance } from './container-instance.class';\nexport { Token } from './token.class';\n/** We export the default container under the Container alias. */\nexport const Container = ContainerInstance.defaultContainer;\nexport default Container;\n//# sourceMappingURL=index.js.map"],"names":["throwError","error","ContainerRegistry","static","container","ContainerInstance","Error","containerMap","has","id","set","registeredContainer","this","get","undefined","delete","dispose","Map","Token","constructor","name","ServiceNotFoundError","message","normalizedIdentifier","identifier","super","prototype","CannotInstantiateValueError","EMPTY_VALUE","Symbol","BUILT_INS","String","Object","Boolean","Array","Number","CannotInstantiateBuiltInError","SERVICE_METADATA_DEFAULTS","multiple","eager","scope","value","factory","LAZY_REFERENCE","INJECTED_FACTORY","resolveToTypeWrapper","typeOrIdentifier","typeWrapper","eagerType","lazyType","isFactory","x","isLazyReference","wrapDependencyAsResolvable","dependency","constraints","isArray","options","HOST_CONTAINER","THROW_IF_DISPOSED","ALWAYS_RESOLVABLE","parent","metadataMap","multiServiceIds","disposed","recursive","includes","location","getIdentifierLocation","response","getOrNull","resolveMetadata","possibleResolution","maybeResolvedMetadata","baseMetadata","type","newServiceMetadata","defaultContainer","newServiceID","dependencies","metadata","toString","getServiceValue","getMany","getManyOrNull","idMap","subject","generatedId","tokens","map","serviceOptions","precompiledDependencies","throwIfDisposed","newMetadata","maskedToken","existingMultiGroup","push","setValue","remove","identifierOrIdentifierArray","forEach","serviceMetadata","disposeServiceInstance","containerId","hasContainer","getContainer","registerContainer","of","ofChild","reset","strategy","service","clear","async","factoryMeta","factoryServiceId","factoryServiceMethod","constructableTargetType","getConstructorParameters","guardBuiltIns","length","wrapper","resolveResolvable","resolvable","resolveTypeWrapper","resolvedIdentifier","isOptional","isSkipSelf","isSelf","isMany","targetContainer","resolved","force","iterator","entries","formatClassName","ctor","Service","optionsOrDependencies","maybeDependencies","targetConstructor","resolvedDependencies","wrappedDependencies","index","JSService","dependenciesOrConstructor","maybeConstructor","HostContainer","Lazy","fn","Optional","Self","SkipSelf","Many","Container"],"mappings":"AAAO,SAASA,EAAWC,GACvB,MAAMA,CACV,CCOO,MAAMC,EASTC,yBAAyBC,GACjBA,aAAqBC,IAAsB,GAE3CL,EAAW,IAAIM,MAAM,wDAErBJ,EAAkBK,aAAaC,IAAIJ,EAAUK,KAE7CT,EAAW,IAAIM,MAAM,4CAEzBJ,EAAkBK,aAAaG,IAAIN,EAAUK,GAAIL,EACpD,CAMDD,oBAAoBM,GAChB,OAAOP,EAAkBK,aAAaC,IAAIC,EAC7C,CAODN,oBAAoBM,GAChB,MAAME,EAAsBC,KAAKL,aAAaM,IAAIJ,GAKlD,YAJ4BK,IAAxBH,GAEAX,EAAW,IAAIM,MAAM,kDAElBK,CACV,CAWDR,6BAA6BC,GACzB,MAAMO,EAAsBT,EAAkBK,aAAaM,IAAIT,EAAUK,SAC7CK,IAAxBH,GAEAX,EAAW,IAAIM,MAAM,kDAGzBJ,EAAkBK,aAAaQ,OAAOX,EAAUK,UAE1CE,EAAoBK,SAC7B,EAQLd,EAAkBK,aAAe,IAAIU,IC1E9B,MAAMC,EAITC,YAAYC,GACRR,KAAKQ,KAAOA,CACf,ECPE,MAAMC,UAA6Bf,MAClCgB,cAC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