{"version":3,"file":"typedi.mjs","sources":["../esm5/constants/minification/native-error.const.mjs","../esm5/constants/minification/strings.const.mjs","../esm5/error/container-registry-error.error.mjs","../esm5/container-registry.class.mjs","../esm5/token.class.mjs","../esm5/utils/normalize-identifier.util.mjs","../esm5/error/service-not-found.error.mjs","../esm5/error/cannot-instantiate-value.error.mjs","../esm5/constants/empty.const.mjs","../esm5/constants/builtins.const.mjs","../esm5/error/cannot-instantiate-builtin-error.mjs","../esm5/constants/service-defaults.const.mjs","../esm5/constants/minification/native-null.const.mjs","../esm5/utils/is-array.util.mjs","../esm5/constants/type-wrapper.const.mjs","../esm5/utils/is-type-wrapper.util.mjs","../esm5/utils/resolve-to-type-wrapper.util.mjs","../esm5/utils/wrap-resolvable-dependency.mjs","../esm5/constants/host-container.const.mjs","../esm5/visitor-collection.class.mjs","../esm5/constants/virtual-ids.const.mjs","../esm5/container-instance.class.mjs","../esm5/decorators/service.decorator.mjs","../esm5/decorators/js-service.decorator.mjs","../esm5/functions/host-container.function.mjs","../esm5/functions/lazy.function.mjs","../esm5/functions/resolution-constraints.functions.mjs"],"sourcesContent":["/**\n * A reference to the host's intrinsic {@link Error} implementation.\n *\n * @remarks\n * This should be preferred instead of direct references to {@link Error}.\n */\nexport const NativeError = Error;\n//# sourceMappingURL=native-error.const.mjs.map","/**\n * @fileoverview\n * This file contains a number of strings used in error messages.\n * Some of them are unfinished sentences, which are then interpolated to create\n * error messages.\n *\n * The primary purpose of storing strings here is to reduce the final\n * size of the bundle.  For instance, consider the following (minified) code:\n *\n * ```ts\n * throw Error(`A container with the specified name (\"${String(t)}\") already exists.`);\n * throw Error(`A container with the specified name (\"${String(t)}) does not already exist.`);\n * ```\n *\n * As can clearly be seen, the string \"A container with the specified name\" is used twice here,\n * for two different scenarios.  As of now, Terser seemingly doesn't create a variable to store\n * the duplicate string, so we do it manually here.\n *\n * The process of replacing duplicate strings with variables should be done cautiously.\n *\n * Instead of performing it to every error message, the generated Terser output should be\n * checked and tested to see if moving the string here has any noticeable impact on the output.\n */\nnull;\nexport const __A_CONTAINER_WITH_THE_SPECIFIED_NAME = 'A container with the specified name';\nexport const __NO_CONTAINER_IS_REGISTERED_WITH_THE_GIVEN_ID = 'No container is registered with the given ID.';\nexport const __CANNOT_USE_CONTAINER_AFTER_IT_HAS_BEEN_DISPOSED = 'Cannot use container after it has been disposed.';\n//# sourceMappingURL=strings.const.mjs.map","// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { NativeError } from '../constants/minification/native-error.const.mjs';\n/**\n * An error thrown from operations within the {@link ContainerRegistry}.\n *\n * @group Errors\n *\n * @see {@link ContainerRegistry}\n */\nexport class ContainerRegistryError extends NativeError {\n    constructor(message) {\n        super(message);\n        this.name = 'ContainerRegistryError';\n    }\n}\n//# sourceMappingURL=container-registry-error.error.mjs.map","import { __NO_CONTAINER_IS_REGISTERED_WITH_THE_GIVEN_ID } from './constants/minification/strings.const.mjs';\nimport { ContainerInstance } from './container-instance.class.mjs';\nimport { ContainerRegistryError } from './error/container-registry-error.error.mjs';\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     * @throws {@link ContainerRegistryError}\n     * This exception is thrown in the following scenarios:\n     *   - If the item being registered is not a container.\n     *   - A container with the same ID already exists in the registry.\n     */\n    static registerContainer(container) {\n        if (container instanceof ContainerInstance === false) {\n            throw new ContainerRegistryError('Only ContainerInstance instances can be registered.');\n        }\n        if (ContainerRegistry.containerMap.has(container.id)) {\n            throw new ContainerRegistryError('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     * @returns Whether a container with the specified ID could be\n     * found in the registry.\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     * @throws {@link ContainerRegistryError}\n     * This exception is thrown when a container with\n     * the given ID does not exist in the registry.\n     */\n    static getContainer(id) {\n        const registeredContainer = ContainerRegistry.containerMap.get(id);\n        if (registeredContainer === undefined) {\n            throw new ContainerRegistryError(__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     * @throws {@link ContainerRegistryError}\n     * This exception is thrown when a container with\n     * the specified ID does not exist in the registry.\n     *\n     * @throws Error\n     * This error may be thrown as a result of disposing the container.\n     * It can be caught asynchronously.\n     */\n    static async removeContainer(container) {\n        const registeredContainer = ContainerRegistry.containerMap.get(container.id);\n        if (registeredContainer === undefined) {\n            throw new ContainerRegistryError(__NO_CONTAINER_IS_REGISTERED_WITH_THE_GIVEN_ID);\n        }\n        ContainerRegistry.containerMap.delete(container.id);\n        /** We dispose all registered classes in the container. */\n        if (!registeredContainer.disposed) {\n            await registeredContainer.dispose();\n        }\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.mjs.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.mjs.map","import { Token } from '../token.class.mjs';\nexport function normalizeIdentifier(identifier) {\n    let name;\n    return typeof identifier === 'string'\n        ? identifier\n        : identifier instanceof Token\n            ? `Token<${identifier.name ?? 'UNSET_NAME'}>`\n            : ((name = identifier?.name ?? identifier.prototype?.name) && `MaybeConstructable<${name}>`) ??\n                '<UNKNOWN_IDENTIFIER>';\n}\n//# sourceMappingURL=normalize-identifier.util.mjs.map","import { NativeError } from '../constants/minification/native-error.const.mjs';\nimport { normalizeIdentifier } from '../utils/normalize-identifier.util.mjs';\n/**\n * Thrown when requested service was not found.\n *\n * @group Errors\n */\nexport class ServiceNotFoundError extends NativeError {\n    constructor(identifier) {\n        super();\n        this.name = 'ServiceNotFoundError';\n        this.normalizedIdentifier = normalizeIdentifier(identifier);\n        this.message =\n            `Service with \"${this.normalizedIdentifier}\" identifier was not found in the container. ` +\n                `Register it before usage via \"Container.set\" or the \"@Service()\" decorator.`;\n    }\n}\n//# sourceMappingURL=service-not-found.error.mjs.map","import { NativeError } from '../constants/minification/native-error.const.mjs';\nimport { normalizeIdentifier } from '../utils/normalize-identifier.util.mjs';\n/**\n * Thrown when DI cannot inject value into property decorated by `@Inject` decorator.\n *\n * @group Errors\n */\nexport class CannotInstantiateValueError extends NativeError {\n    constructor(identifier, footer = '') {\n        super();\n        this.footer = footer;\n        this.name = 'CannotInstantiateValueError';\n        this.normalizedIdentifier = normalizeIdentifier(identifier);\n        this.message =\n            `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                this.footer;\n    }\n}\n//# sourceMappingURL=cannot-instantiate-value.error.mjs.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.mjs.map","/**\n * A list of functions representing built-in types.\n * @ignore @internal\n *\n * @privateRemarks\n * When these are used as dependencies for a service which does not\n * have a corresponding factory, TypeDI will throw an error.\n * This is because, while these functions *are* valid constructors,\n * in most cases they won't create what the caller expected when\n * instantiated.\n * Furthermore, they won't resolve in the context of the container.\n */\nexport const BUILT_INS = [String, Object, Boolean, Symbol, Array, Number];\n//# sourceMappingURL=builtins.const.mjs.map","import { CannotInstantiateValueError } from './cannot-instantiate-value.error.mjs';\n/**\n * Thrown when DI encounters a service depending on a built-in type (Number, String) with no factory.\n *\n * @group Errors\n */\nexport class CannotInstantiateBuiltInError extends CannotInstantiateValueError {\n    constructor(identifier, footer) {\n        super(identifier, footer);\n        this.message = super.message + ` If your service requires built-in or unresolvable types, please use a factory.`;\n    }\n}\n//# sourceMappingURL=cannot-instantiate-builtin-error.mjs.map","import { EMPTY_VALUE } from './empty.const.mjs';\n/**\n * An object containing default values for services.\n * @ignore @internal\n *\n * @remarks\n * This can then be merged in to passed-in services to provide them with\n * default configuration where 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.mjs.map","export const NativeNull = null;\n//# sourceMappingURL=native-null.const.mjs.map","/**\n * A re-export of {@link Array.isArray}.\n *\n * This has two benefits:\n *   1. We prevent any unexpected behaviour by assuming the environment is hostile.\n *      By caching the function, we are able to (reasonably) safely assume that we\n *      have attained a copy of it prior to any user-modification.\n *   2. It reduces the final size of the bundle.\n */\nexport const { isArray } = Array;\n//# sourceMappingURL=is-array.util.mjs.map","export const TYPE_WRAPPER = Symbol('type-wrapper');\n//# sourceMappingURL=type-wrapper.const.mjs.map","import { TYPE_WRAPPER } from '../constants/type-wrapper.const.mjs';\nexport function isTypeWrapper(x) {\n    return x[TYPE_WRAPPER] === 0 /* TypeWrapperStamp.Generic */;\n}\n//# sourceMappingURL=is-type-wrapper.util.mjs.map","import { TYPE_WRAPPER } from '../constants/type-wrapper.const.mjs';\nimport { Token } from '../token.class.mjs';\nimport { isTypeWrapper } from './is-type-wrapper.util.mjs';\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    const inputType = typeof typeOrIdentifier;\n    /** If requested type is explicitly set via a string ID or token, we set it explicitly. */\n    if (typeOrIdentifier && (inputType === 'string' || typeOrIdentifier instanceof Token || inputType === 'function')) {\n        typeWrapper = {\n            [TYPE_WRAPPER]: 0 /* TypeWrapperStamp.Generic */,\n            /** We have to use 'as any' casts here due to moving the \"typeof\" checks to a constant. */\n            eagerType: typeOrIdentifier,\n            lazyType: () => typeOrIdentifier,\n        };\n    }\n    else if (inputType === 'object' && isTypeWrapper(typeOrIdentifier)) {\n        /**\n         * Any arguments which are type-wrappers shouldn't be modified; instead, they should\n         * be directly passed to the caller.\n         * This allows for functions such as {@link Lazy} and {@link TransientRef} to function.\n         */\n        return typeOrIdentifier;\n    }\n    return typeWrapper;\n}\n//# sourceMappingURL=resolve-to-type-wrapper.util.mjs.map","import { BUILT_INS } from '../constants/builtins.const.mjs';\nimport { NativeError } from '../constants/minification/native-error.const.mjs';\nimport { NativeNull } from '../constants/minification/native-null.const.mjs';\nimport { CannotInstantiateBuiltInError } from '../error/cannot-instantiate-builtin-error.mjs';\nimport { CannotInstantiateValueError } from '../error/cannot-instantiate-value.error.mjs';\nimport { isArray } from './is-array.util.mjs';\nimport { resolveToTypeWrapper } from './resolve-to-type-wrapper.util.mjs';\nexport function wrapDependencyAsResolvable(dependency, serviceOptions, index) {\n    let constraints;\n    let typeWrapper;\n    if (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 == NativeNull || options == NativeNull) {\n            // TODO: make this more descriptive\n            throw NativeError('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    /**\n     * Do basic checks on dependencies here.\n     * This is primarily done as a performance optimisation, as {@link ContainerInstance.set}\n     * already iterates the array using this utility, so we can avoid iterating\n     * the same array twice if we check each dependency inline.\n     */\n    const { eagerType } = typeWrapper;\n    if (eagerType !== NativeNull) {\n        const type = typeof typeWrapper;\n        // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n        const errorFooter = `Occurred from dependency ${index} of service ${serviceOptions.type?.name}.`;\n        if (type !== 'function' && type !== 'object' && type !== 'string') {\n            throw new CannotInstantiateValueError(eagerType, errorFooter);\n        }\n        else if (serviceOptions.factory == NativeNull && 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            throw new CannotInstantiateBuiltInError(eagerType?.name ?? eagerType, errorFooter);\n        }\n    }\n    return {\n        constraints,\n        typeWrapper,\n    };\n}\n//# sourceMappingURL=wrap-resolvable-dependency.mjs.map","import { Token } from '../token.class.mjs';\n/**\n * A special identifier which can be used to get the container\n * the service is currently being executed under.\n *\n * @example\n * Here is an example:\n * ```ts\n * @Service([\n *   HostContainer()\n * ])\n * class MyService {\n *   constructor (private container: ContainerInstance) { }\n * }\n * ```\n *\n * @see {@link HostContainer}\n */\nexport const HOST_CONTAINER = new Token('Host Container');\n//# sourceMappingURL=host-container.const.mjs.map","import { defaultContainer } from './container-instance.class.mjs';\n/**\n * A collection of individual visitor objects, combined into a collection.\n * This class implements the {@link ContainerTreeVisitor} interface\n * (modulo {@link ContainerTreeVisitor.visitContainer}).\n *\n * When an event is dispatched upon the collection, all attached\n * visitors will be notified in the order in which they were\n * added to the collection.\n * @experimental\n *\n * @example\n * ```ts\n * const collection = new VisitorCollection();\n *\n * // Add our visitor to the collection.\n * collection.addVisitor(new MyVisitor());\n *\n * // Dispatch an event onto the collection,\n * // which will be broadcast to all attached visitors.\n * collection.visitChildContainer(Container.ofChild('hello'));\n * ```\n *\n * @group Tree Visitors\n */\nexport class VisitorCollection {\n    constructor() {\n        /** Whether the instance is disposed. */\n        this.disposed = false;\n        /** The visitors stored within the collection. */\n        this.visitors = [];\n        /**\n         * A flag stating whether any visitors are currently present in the collection.\n         * If not, all notifications will be ignored.\n         *\n         * This is mostly for optimisation.\n         */\n        this.anyVisitorsPresent = false;\n    }\n    /**\n     * A flag which states whether any visitors should be notified.\n     * If the collection has been disposed or no visitors are present,\n     * this evaluates to `false`.\n     */\n    get notifyVisitors() {\n        return !this.disposed && this.anyVisitorsPresent;\n    }\n    /**\n     * Iterate the list of visitors, excluding any which have been disposed.\n     * Does not perform any iteration if no visitors are present.\n     *\n     * @param callback A function to call for each visitor in the collection.\n     */\n    forEachVisitor(callback) {\n        if (this.notifyVisitors) {\n            this.visitors.forEach(visitor => {\n                /** If the visitor has been disposed since the last iteration, free it from the store. */\n                if (visitor.disposed) {\n                    this.removeVisitorFromCollection(visitor);\n                    return;\n                }\n                /** Disposed visitors should not be notified. */\n                callback(visitor);\n            });\n        }\n    }\n    /**\n     * Notify all attached visitors of a newly-created child container.\n     * @internal\n     *\n     * @see {@link ContainerTreeVisitor.visitChildContainer}\n     */\n    notifyChildContainerVisited(child) {\n        this.forEachVisitor(visitor => visitor.visitChildContainer?.(child));\n    }\n    /**\n     * Notify all attached visitors of a newly-created orphaned container.\n     * @internal\n     *\n     * @see {@link ContainerTreeVisitor.visitOrphanedContainer}\n     */\n    notifyOrphanedContainerVisited(container) {\n        this.forEachVisitor(visitor => visitor.visitOrphanedContainer?.(container));\n    }\n    /**\n     * Notify all attached visitors of a newly-created service.\n     * @internal\n     *\n     * @see {@link ContainerTreeVisitor.visitNewService}\n     */\n    notifyNewServiceVisited(serviceOptions) {\n        this.forEachVisitor(visitor => visitor.visitNewService?.(serviceOptions));\n    }\n    /**\n     * Notify all attached visitors of a retrieval.\n     * @internal\n     *\n     * @see {@link ContainerTreeVisitor.visitRetrieval}\n     */\n    notifyRetrievalVisited(identifier, options) {\n        this.forEachVisitor(visitor => visitor.visitRetrieval?.(identifier, options));\n    }\n    /**\n     * Add a visitor to the collection.\n     * @experimental\n     *\n     * @param visitor The visitor to append to the collection.\n     * @param container The container to initialise the container on.\n     */\n    addVisitorToCollection(visitor, container) {\n        /** If the visitor is already present, do not add another. */\n        if (this.visitors.includes(visitor)) {\n            return false;\n        }\n        if ('visitOrphanedContainer' in visitor && container !== defaultContainer) {\n            /**\n             * Orphaned container events are only dispatched on the default container.\n             * Therefore, we need to create a proxy that forwards this event from the\n             * default container to this visitor.\n             */\n            VisitorCollection.forwardOrphanedContainerEvents(visitor);\n        }\n        this.visitors.push(visitor);\n        /**\n         * Mark the collection as having visitors present, so\n         * it doesn't ignore any events passed to it.\n         */\n        if (!this.anyVisitorsPresent) {\n            this.anyVisitorsPresent = true;\n        }\n        let isAllowedToAttachVisitor;\n        try {\n            /**\n             * Directly call the visitor's \"visitContainer\" method\n             * to initialise it upon the given container.\n             *\n             * Implementation detail: We don't provide any sort of protection against\n             * this being called again on a different container.\n             * The visitor would be able to handle that themselves, as the API states\n             * that any call to `visitContainer` means that the visitor was added\n             * to a container.\n             */\n            isAllowedToAttachVisitor = visitor.visitContainer?.(container);\n        }\n        finally {\n            /**\n             * If a false-y return value was returned to signal that the visitor\n             * should not be attached to the given container, immediately remove it.\n             */\n            if (!isAllowedToAttachVisitor) {\n                this.removeVisitorFromCollection(visitor);\n            }\n        }\n        return isAllowedToAttachVisitor;\n    }\n    /**\n     * Remove a visitor from the collection,\n     * if it was already present.\n     * @experimental\n     *\n     * @param visitor The visitor to remove from the collection.\n     */\n    removeVisitorFromCollection(visitor) {\n        const indexOfVisitor = this.visitors.indexOf(visitor);\n        if (indexOfVisitor === -1) {\n            return false;\n        }\n        /** Remove the element from the array via \"splice\". */\n        this.visitors.splice(indexOfVisitor, 1);\n        /** Re-evalute the length of the visitors array and recompute anyVisitorsPresent. */\n        if (this.visitors.length === 0) {\n            this.anyVisitorsPresent = false;\n        }\n        return true;\n    }\n    /**\n     * Forward any orphaned container events to the visitor\n     * through a proxy visitor attached to the default container.\n     *\n     * This is used when a visitor implements the {@link ContainerTreeVisitor.visitOrphanedContainer}\n     * handler, but the visitor was attached to a non-default container instance.\n     */\n    static forwardOrphanedContainerEvents(upstreamVisitor) {\n        const proxyVisitor = {\n            get disposed() {\n                return upstreamVisitor.disposed;\n            },\n            dispose() {\n                /**\n                 * We don't forward the disposal of this proxy visitor upstream, as doing so may cause\n                 * unintended consequences.  For all purposes, this visitor is invisible to the upstream\n                 * one, and so any state it encounters should be kept at bay.\n                 */\n                this.disposed = true;\n            },\n            visitOrphanedContainer(container) {\n                if (!this.disposed) {\n                    /** Proxy the call to the upstream visitor. */\n                    upstreamVisitor.visitOrphanedContainer(container);\n                }\n            },\n            visitContainer(container) {\n                /**\n                 * The check here is just for redundancy.  It ensures that, in the event of attachment\n                 * to a non-default container, this visitor would immediately become unmounted.\n                 *\n                 * This is done to be 100% sure that the visitor is launched in the correct container.\n                 * One instance where this could be useful is if the visitors of the default container\n                 * are blindly copied to another container.\n                 */\n                return container === defaultContainer;\n            },\n        };\n        return defaultContainer.acceptTreeVisitor(proxyVisitor);\n    }\n    async dispose() {\n        /** Prevent duplicate calls to dispose. */\n        if (this.disposed) {\n            return;\n        }\n        this.disposed = true;\n        /** Return a mega-promise of all the visitors' disposal results. */\n        await Promise.all(this.visitors.map(visitor => visitor.dispose()));\n    }\n}\n//# sourceMappingURL=visitor-collection.class.mjs.map","import { HOST_CONTAINER } from './host-container.const.mjs';\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 */\nexport const VIRTUAL_IDENTIFIERS = [\n    /**\n     * Provide compatibility with the `HostContainer()` API.\n     */\n    HOST_CONTAINER,\n];\n//# sourceMappingURL=virtual-ids.const.mjs.map","/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */\nimport { ContainerRegistry } from './container-registry.class.mjs';\nimport { ServiceNotFoundError } from './error/service-not-found.error.mjs';\nimport { CannotInstantiateValueError } from './error/cannot-instantiate-value.error.mjs';\nimport { Token } from './token.class.mjs';\nimport { EMPTY_VALUE } from './constants/empty.const.mjs';\nimport { BUILT_INS } from './constants/builtins.const.mjs';\nimport { CannotInstantiateBuiltInError } from './error/cannot-instantiate-builtin-error.mjs';\nimport { SERVICE_METADATA_DEFAULTS } from './constants/service-defaults.const.mjs';\nimport { wrapDependencyAsResolvable } from './utils/wrap-resolvable-dependency.mjs';\nimport { HOST_CONTAINER } from './constants/host-container.const.mjs';\nimport { VisitorCollection } from './visitor-collection.class.mjs';\nimport { __A_CONTAINER_WITH_THE_SPECIFIED_NAME, __CANNOT_USE_CONTAINER_AFTER_IT_HAS_BEEN_DISPOSED, } from './constants/minification/strings.const.mjs';\nimport { isArray } from './utils/is-array.util.mjs';\nimport { NativeError } from './constants/minification/native-error.const.mjs';\nimport { NativeNull } from './constants/minification/native-null.const.mjs';\nimport { VIRTUAL_IDENTIFIERS } from './constants/virtual-ids.const.mjs';\nlet defaultContainer;\n/**\n * # The Container.\n *\n * A container allows you to get, set, and modify dependencies in-place.\n * You can also attach individual services to a container, using them\n * to store services for later execution.\n *\n * @see https://typedi.js.org/docs/guide/containers/introduction\n *\n * @example\n * ```ts\n * const container = defaultContainer.ofChild('my-new-container');\n *\n * @Service({ container })\n * class MyService { }\n * ```\n */\nexport class ContainerInstance {\n    /**\n     * Create a {@link 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         * @remarks\n         * This is readonly for outside consumers.\n         * Its value will change to `true` if the instance is disposed.\n         */\n        this.disposed = false;\n        /**\n         * The currently-present visitors attached to the container.\n         * These are conjoined into a container of individual visitors,\n         * which implements the standard ContainerTreeVisitor interface,\n         * and individual listeners can be added and removed at will.\n         *\n         * @see {@link ContainerTreeVisitor}\n         * @see {@link VisitorCollection}\n         */\n        this.visitor = new VisitorCollection();\n        /**\n         * Whether the container is currently retrieving an identifier\n         * which visitors should not be notified of.\n         *\n         * This is used to prevent {@link ContainerInstance.getManyOrNull}\n         * from notifying visitors that it is retrieving a masked token,\n         * which is used to store services of `{ multiple: true }`.\n         */\n        this.isRetrievingPrivateToken = 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     * @param [recursive=true] Whether the operation will be recursive.\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.throwIfDisposed();\n        /**\n         * Virtual identifiers (HostContainer(), etc.) are always present.\n         *\n         * TODO: The .includes check here might be better replaced by a hard-coded comparison\n         * to all members of the `VIRTUAL_IDENTIFIERS` array for additional performance.\n         */\n        if (VIRTUAL_IDENTIFIERS.includes(identifier)) {\n            return true;\n        }\n        const location = this.getIdentifierLocation(identifier, recursive);\n        if (recursive && location === 1 /* ServiceIdentifierLocation.Parent */) {\n            return true;\n        }\n        return location === 0 /* 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 {@link ServiceIdentifierLocation}.\n     *  - If the identifier cannot be found, {@link ServiceIdentifierLocation.None | None}.\n     *  - If the identifier is found locally, {@link ServiceIdentifierLocation.Local | Local}.\n     *  - If the identifier is found upstream, {@link ServiceIdentifierLocation.Parent | Parent}.\n     *\n     * @throws Error\n     * This exception is thrown if the container has been disposed.\n     */\n    getIdentifierLocation(identifier, recursive = true) {\n        this.throwIfDisposed();\n        if (this.metadataMap.has(identifier) || this.multiServiceIds.has(identifier)) {\n            return 0 /* ServiceIdentifierLocation.Local */;\n        }\n        /**\n         * If we have a parent, check if that has the identifier.\n         * Note that our usage of \"parent\" here doesn't necessarily mean that the identifier\n         * comes from the parent itself; if the parent can't find it, it'll walk the hierarchy\n         * until it either exhausts the tree, resulting in None, or Parent.\n         */\n        if (recursive && this.parent?.has(identifier, true)) {\n            return 1 /* ServiceIdentifierLocation.Parent */;\n        }\n        return 2 /* 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        /**\n         * Re-use the {@link EMPTY_VALUE} to avoid having to declare another symbol.\n         * This is fine, as the method will never return this symbol a resolved value.\n         */\n        const response = this.getOrDefault(identifier, EMPTY_VALUE, recursive);\n        if (response === EMPTY_VALUE) {\n            throw 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     *   {@link 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.throwIfDisposed();\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, recursive);\n        switch (location) {\n            case 2 /* ServiceIdentifierLocation.None */:\n                return NativeNull;\n            case 0 /* ServiceIdentifierLocation.Local */:\n                return [this.metadataMap.get(identifier), location];\n            case 1 /* ServiceIdentifierLocation.Parent */:\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], 1 /* ServiceIdentifierLocation.Parent */] : NativeNull;\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     * @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        return this.getOrDefault(identifier, NativeNull, recursive);\n    }\n    /**\n     * Retrieves the service with given name or type from the service container.\n     * If the identifier cannot be found, return the provided default value.\n     *\n     * @typeParam U The type of the provided default value.\n     *\n     * @see {@link ContainerInstance.getOrNull}\n     *\n     * @param identifier The identifier to get the value of.\n     *\n     * @returns The resolved value for the given metadata, or the default value if it could not be found.\n     *\n     * @throws Error\n     * This exception is thrown if the container has been disposed.\n     */\n    getOrDefault(identifier, defaultValue, recursive = true) {\n        this.throwIfDisposed();\n        /**\n         * Use the internal flag as a guide to whether we should\n         * notify visitors of this retrieval.\n         */\n        const notifyVisitors = !this.isRetrievingPrivateToken;\n        /**\n         * Keep a partial object containing some of the options to pass to visitors,\n         * so we don't have to declare the same values in multiple code-paths.\n         */\n        const partialVisitRetrievalOptions = { recursive, many: false };\n        /**\n         * Provide compatibility with the `HostContainer()` API.\n         */\n        if (identifier === HOST_CONTAINER) {\n            if (notifyVisitors) {\n                this.visitor.notifyRetrievalVisited(identifier, {\n                    ...partialVisitRetrievalOptions,\n                    location: 0 /* ServiceIdentifierLocation.Local */,\n                });\n            }\n            return this;\n        }\n        const maybeResolvedMetadata = this.resolveMetadata(identifier, recursive);\n        if (maybeResolvedMetadata === NativeNull) {\n            if (notifyVisitors) {\n                /** Notify our listeners that the identifier wasn't found. */\n                this.visitor.notifyRetrievalVisited(identifier, {\n                    ...partialVisitRetrievalOptions,\n                    location: 2 /* ServiceIdentifierLocation.None */,\n                });\n            }\n            return defaultValue;\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 === 1 /* 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            /**\n             * If the service is a singleton, return it directly from the global container.\n             * We can safely assume it exists there.\n             *\n             * Note that we avoid caching singleton instances in the container.\n             */\n            if (baseMetadata.scope === 'singleton') {\n                return defaultContainer.getOrDefault(identifier, defaultValue, recursive);\n            }\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            const isReconstructable = baseMetadata.factory != NativeNull || baseMetadata.type != NativeNull;\n            if (!isReconstructable) {\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             * Import it into the current container, and then recursively\n             * call .getOrNull which takes the local path instead of\n             * dealing with upstream metadata.\n             */\n            const newServiceID = this.set(newServiceMetadata, [...baseMetadata.dependencies]);\n            /**\n             * Cache the value in a variable so we're able to wrap the call in the\n             * {@link ContainerInstance.isRetrievingPrivateToken} flag to prevent\n             * notifying visitors.\n             */\n            this.isRetrievingPrivateToken = true;\n            const resolvedValue = this.getOrDefault(newServiceID, defaultValue, recursive);\n            /** Reset the flag to its original value. */\n            this.isRetrievingPrivateToken = false;\n            this.visitor.notifyRetrievalVisited(identifier, {\n                ...partialVisitRetrievalOptions,\n                location: 1 /* ServiceIdentifierLocation.Parent */,\n            });\n            return resolvedValue;\n        }\n        /**\n         * Notify our listeners that the identifier was found.\n         * We do this *after* the above importing code as otherwise, we would have to\n         * set the {@link ContainerInstance.isRetrievingPrivateToken} flag.\n         */\n        if (notifyVisitors) {\n            this.visitor.notifyRetrievalVisited(identifier, {\n                ...partialVisitRetrievalOptions,\n                location,\n            });\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 = defaultContainer.metadataMap.get(identifier);\n        }\n        /** This should never happen as multi services are masked with custom token in Container.set. */\n        if (metadata?.multiple) {\n            /* eslint-disable @typescript-eslint/restrict-template-expressions */\n            /* istanbul ignore next */\n            throw NativeError(`Cannot resolve multiple values for ${identifier} service!`);\n            /* eslint-enable @typescript-eslint/restrict-template-expressions */\n        }\n        /** Otherwise it's returned from the current / parent container. */\n        if (metadata) {\n            return this.getServiceValue(metadata);\n        }\n        return defaultValue;\n    }\n    /**\n     * Gets all instances registered in the container of the given service identifier.\n     * Used when service are defined with the `{ multiple: true }` option.\n     *\n     * @example\n     * ```ts\n     * Container.set({ id: 'key', value: 1, multiple: true });\n     * Container.set({ id: 'key', value: 2, multiple: true });\n     * Container.set({ id: 'key', value: 3, multiple: true });\n     *\n     * const [one, two, three] = Container.getMany('key');\n     * ```\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        /**\n         * Re-use the {@link EMPTY_VALUE} to avoid having to declare another symbol.\n         * This is fine, as the method will never return this symbol a resolved value.\n         */\n        const response = this.getManyOrDefault(identifier, EMPTY_VALUE, recursive);\n        if (response === EMPTY_VALUE) {\n            throw 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 are defined with the `{ multiple: true }` option.\n     *\n     * @example\n     * Here's an example:\n     * ```ts\n     * assert(container.getManyOrNull(UNKNOWN_TOKEN) === null);\n     * assert(Array.isArray(container.getManyOrNull(KNOWN_TOKEN)));\n     * ```\n     *\n     * @param identifier The identifier to resolve.\n     *\n     * @see {@link ContainerInstance.getMany}\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        return this.getManyOrDefault(identifier, NativeNull, recursive);\n    }\n    /**\n     * Gets all instances registered in the container of the given service identifier,\n     * or the default value if no instances could be found.\n     * Used when service are defined with the `{ multiple: true }` option.\n     *\n     * @typeParam U The type of the provided default value.\n     *\n     * @see {@link ContainerInstance.getManyOrNull}\n     * @see {@link ContainerInstance.getMany}\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, the default value is returned.\n     *\n     * @throws Error\n     * This exception is thrown if the container has been disposed.\n     */\n    getManyOrDefault(identifier, defaultValue, recursive = true) {\n        this.throwIfDisposed();\n        // TODO: redo this, very clunky wording.\n        /**\n         * # An explanation of `multiple: true` semantics\n         *\n         * Internally, we store IDs set with `{ multiple: true }` as objects containing anonymous tokens\n         * which are then stored in the usual metadata map.  For every many-to-one value stored with the\n         * flag gets its own token, and that token is then added to an object which is stored in the\n         * \"multiServiceIds\" Map, with the public identifier used as a key.\"\n         *\n         * To demonstrate this, let's provide an example:\n         *\n         * ```ts\n         * const NAME = new Token<string>();\n         *\n         * Container.set({ id: NAME, multiple: true, value: 1 });\n         * Container.set({ id: NAME, multiple: true, value: 2 });\n         * ```\n         *\n         * *Internally, this code will result in the following:*\n         *\n         * The container checks if the identifier (which, in this case, is `NAME`) is present\n         * in the {@link ContainerInstance.multiServiceIds} Map.  If it is not, an object is\n         * created with the following properties:\n         *\n         * ```ts\n         * interface ManyServicesMetadata {\n         *   scope: ContainerScope;\n         *   tokens: Token<unknown>[];\n         * }\n         * ```\n         *\n         * This object is then stored in the {@link Container.multiServiceIds} Map, with the key\n         * being the identifier passed to {@link Container.set} by the user.  In the above example,\n         * the identifier would be the `NAME` token.\n         *\n         * 1. The `scope` property is a {@link ContainerScope}.\n         *    It tells {@link ContainerInstance.getManyOrDefault} how to resolve the identifier.\n         * 2. The `tokens` property is explained below.\n         *\n         * For each call to {@link ContainerInstance.set} with `multiple: true`, a new {@link Token} is created.\n         * This would then be passed to {@link ContainerInstance.set}, much like an ordinary call to set a new value.\n         *\n         * The new {@link Token} is then bound to a value.\n         * In the case of the above example, the value is the number 1.\n         *\n         * Once the token has been bound, it is then added to the array of tokens\n         * inside the {@link ManyServicesMetadata} object referenced above.\n         *\n         * ---\n         *\n         * In the presence of new features, this deceptively simplistic design has required some\n         * specialized support to accomplish correctly.\n         *\n         * For example, in the case of the {@link ContainerTreeVisitor} API,\n         * a flag ({@link ContainerInstance.isRetrievingPrivateToken} was required to prevent callers\n         * being notified of the retrieval of anonymous tokens to retrieve values required by a call\n         * to {@link ContainerInstance.getMany} (or its counterparts).\n         *\n         * Furthermore, this design has one implicit side-effect: the scope of all values associated\n         * with a single identifier must be equal.  For example, you would not be able to set one\n         * value as a singleton, and have another as a transient service -- in the current API,\n         * this would not be possible.\n         */\n        const [location, idMap] = this.resolveMultiID(identifier, recursive);\n        /** Notify listeners we have retrieved a service. */\n        this.visitor.notifyRetrievalVisited(identifier, {\n            recursive,\n            many: true,\n            location,\n        });\n        /** If no IDs could be found, return null. */\n        if (!idMap) {\n            return defaultValue;\n        }\n        /**\n         * Prevent {@link ContainerInstance.getOrNull} from notifying\n         * visitors that we are retrieving a masked token.\n         */\n        this.isRetrievingPrivateToken = true;\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 mapped = idMap.tokens.map((generatedId) => this.get(generatedId, recursive));\n        /** Restore the flag we set above to its original value. */\n        this.isRetrievingPrivateToken = false;\n        return mapped;\n    }\n    /**\n     * Recursively check the presence of a multi-service identifier in the container hierarchy.\n     *\n     * @param id The ID to lookup in the container hierarchy.\n     * @param recursive Whether the operation will be performed recursively.\n     * If this is set to `false`, the identifier will only be looked up in the context\n     * of this container, regardless of whether the parent has the identifier.\n     *\n     * @returns A tuple, with the first element specifying the location of the identifier\n     * (or {@link ServiceIdentifierLocation.None | None} if it wasn't found), with the\n     * second element being the value associated with the specified identifier.\n     *\n     * @example\n     * ```ts\n     * // Create a new container, as a child of a child of the default container.\n     * const myContainer = Container.ofChild(Symbol()).ofChild(Symbol());\n     * const MY_SERVICE = new Token<MyService>();\n     *\n     * // Add a service to the default container, as a value of the MY_SERVICE group.\n     * @Service({ container: myContainer, id: MY_SERVICE, multiple: true }, [ ])\n     * class MyService { }\n     *\n     * // Add another service to the default container, as a value of the MY_SERVICE group.\n     * Container.set({ id: MY_SERVICE, multiple: true, value: Symbol() });\n     *\n     * // Get the multi-IDs from the child container.\n     * const [myService, mySymbol] = myContainer.getMany(MY_SERVICE);\n     * ```\n     *\n     * @remarks\n     * This replaces the previous implementation, which did not implement proper recursion,\n     * as it only inherited from the direct container of a parent.\n     */\n    resolveMultiID(id, recursive = true) {\n        if (this.multiServiceIds.has(id)) {\n            return [0 /* ServiceIdentifierLocation.Local */, this.multiServiceIds.get(id)];\n        }\n        if (recursive && this.parent) {\n            const [location, value] = this.parent.resolveMultiID(id);\n            if (location !== 2 /* ServiceIdentifierLocation.None */) {\n                return [1 /* ServiceIdentifierLocation.Parent */, value];\n            }\n        }\n        /**\n         * Implementation note: To match the behaviour of normal identifiers, we don't check\n         * the default container here -- that is done through the regular search above.\n         *\n         * Therefore, if a container sets a singleton variable, and is an orphan, it won't\n         * have any knowledge of it.\n         */\n        return [2 /* ServiceIdentifierLocation.None */, NativeNull];\n    }\n    set(serviceOptions, precompiledDependencies) {\n        this.throwIfDisposed();\n        /**\n         * Check if the identifier being set is a virtual one,\n         * such as HostContainer.\n         * If so, we can't reasonably allow this service to be set.\n         */\n        if (VIRTUAL_IDENTIFIERS.includes(serviceOptions.id)) {\n            throw NativeError('Virtual identifiers can not be overridden.');\n        }\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' && 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 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((dependency, index) => \n            // eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- This is completely wrong.\n            wrapDependencyAsResolvable(dependency, serviceOptions, index)) ??\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: NativeNull,\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        this.visitor.notifyNewServiceVisited(newMetadata);\n        /** If the incoming metadata is marked as multiple we mask the ID and continue saving as single value. */\n        if (newMetadata.multiple) {\n            // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n            const maskedToken = new Token(`MultiMaskToken-${newMetadata.id}`);\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, { 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        /** 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     * @example\n     * ```ts\n     * // We can simplify this:\n     * Container.set({ id: 'key', value: 'test', dependencies: [ ] });\n     * // To this:\n     * Container.setValue('key', 'test');\n     * ```\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 {@link ContainerInstance.get | .get} to resolve the identifier.\n     *\n     * @throws Error\n     * This exception is thrown if the container has been disposed.\n     */\n    setValue(id, value) {\n        if (typeof id !== 'string' && !(id instanceof Token)) {\n            throw NativeError('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     * @example\n     * Here's an example:\n     * ```ts\n     * const NAME = new Token<string>();\n     *\n     * // Set a new identifier in the container:\n     * defaultContainer.setValue(NAME, 'Joanna');\n     * assert(defaultContainer.get(NAME) === 'Joanna');\n     *\n     * // Now remove it, making the container forget it ever existed:\n     * defaultContainer.remove(NAME);\n     * assert(defaultContainer.getOrNull(NAME) === null);\n     * ```\n     *\n     * @returns The current {@link ContainerInstance} instance.\n     *\n     * @throws Error\n     * This exception is thrown if the container has been disposed.\n     */\n    remove(identifierOrIdentifierArray) {\n        this.throwIfDisposed();\n        if (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     * @remarks This is functionally equivalent to {@link ContainerInstance.of}.\n     * However, it allows container creation from a static interface.\n     *\n     * @example\n     * ```ts\n     * // Create a container which has the default container as its parent:\n     * ContainerInstance.of('my-new-container');\n     *\n     * // Create a container without a parent:\n     * ContainerInstance.of('my-new-container-without-a-parent', null);\n     *\n     * // Create a container with a separate container:\n     * ContainerInstance.of('my-new-special-container', myOtherContainer);\n     * ```\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.\n     * Defaults to the default container.\n     * @param options The options to supplement how the container is created.\n     *\n     * @see {@link CreateContainerOptions}\n     *\n     * @returns The newly-created {@link ContainerInstance}, or the pre-existing container with the same name\n     * if one already exists.\n     */\n    static of(containerId = 'default', parent = defaultContainer, options) {\n        if (containerId === 'default') {\n            return defaultContainer;\n        }\n        let container;\n        const conflictDefinition = options?.conflictDefinition ?? 'rejectAll';\n        /**\n         * If a conflict definition is passed without an accompanying strategy,\n         * we default to `throw`. This makes the API more consistent.\n         */\n        const onConflict = options?.onConflict ?? (options?.conflictDefinition ? 'throw' : 'returnExisting');\n        const onFree = options?.onFree ?? 'returnNew';\n        if (ContainerRegistry.hasContainer(containerId)) {\n            container = ContainerRegistry.getContainer(containerId);\n            /**\n             * Test whether the container matches according to the conflict\n             * definition given by the caller.\n             */\n            const containerMatches = conflictDefinition === 'allowSameParent'\n                ? container.parent === parent\n                : /**\n                   * To shave a few bytes off the output, we emit false here, as that should\n                   * always happen if the value is 'rejectAll' (and we've narrowed it to that).\n                   */\n                    false;\n            if (!containerMatches) {\n                /** Note: 'returnExisting' is deliberately ignored here, as that is the default logic. */\n                if (onConflict === 'null') {\n                    /**\n                     * The cast here is correct.\n                     * TypeScript isn't smart enough to understand that, if 'onConflict' is 'null'\n                     * and the container already exists, we're allowed to return null to the caller.\n                     */\n                    return NativeNull;\n                }\n                else if (onConflict === 'throw') {\n                    // eslint-disable-next-line @typescript-eslint/restrict-template-expressions -- Implicitly toString.\n                    throw NativeError(`${__A_CONTAINER_WITH_THE_SPECIFIED_NAME} (\"${containerId}\") already exists.`);\n                }\n            }\n        }\n        else {\n            if (onFree === 'null') {\n                /** As above: The cast here is correct. */\n                return NativeNull;\n            }\n            else if (onFree === 'throw') {\n                // eslint-disable-next-line @typescript-eslint/restrict-template-expressions -- Implicitly toString.\n                throw NativeError(`${__A_CONTAINER_WITH_THE_SPECIFIED_NAME} (\"${containerId}\") does not already exist.`);\n            }\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            if (parent === NativeNull) {\n                /**\n                 * To keep an understandable API surface, visitors attached to\n                 * the default container are notified of the new orphaned service here.\n                 * _Note: Orphaned container notifications are only sent for newly-created containers, not duplicate .of calls._\n                 */\n                defaultContainer.visitor.notifyOrphanedContainerVisited(container);\n            }\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 {@link ContainerInstance}, or the pre-existing container\n     * with the same name if one already exists.\n     */\n    of(containerId, options) {\n        // Todo: make this get the constructor at runtime to aid\n        // extension of the class.\n        /** _Note: The visitor API is not called here, as that is handled in the static method._ */\n        return ContainerInstance.of(containerId, defaultContainer, options);\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 {@link ContainerInstance}, or the pre-existing container\n     * with the same name if one already exists.\n     *\n     * @throws Error\n     * This exception is thrown if the container has been disposed.\n     */\n    ofChild(containerId, options) {\n        this.throwIfDisposed();\n        const newContainer = ContainerInstance.of(containerId, this, options);\n        if (newContainer) {\n            this.visitor.notifyChildContainerVisited(newContainer);\n        }\n        return newContainer;\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.throwIfDisposed();\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                throw NativeError('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     * @async\n     *\n     * @remarks\n     * It is currently not advised to dispose of the default container.\n     * This would result in resolution issues in your application.\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    dispose() {\n        // eslint-disable-next-line @typescript-eslint/require-await\n        if (this.disposed) {\n            return Promise.reject(new NativeError(__CANNOT_USE_CONTAINER_AFTER_IT_HAS_BEEN_DISPOSED));\n        }\n        const promise = Promise.all([this.visitor.dispose(), this.reset({ strategy: 'resetServices' })]);\n        /** We mark the container as disposed, forbidding any further interaction with it. */\n        this.disposed = true;\n        /** Cast the promise to `Promise<void>` as expected. */\n        // eslint-disable-next-line @typescript-eslint/no-empty-function\n        return promise.then(() => { });\n    }\n    /**\n     * Throw if the instance has been disposed.\n     * @internal\n     *\n     * @remarks\n     * This is used to prevent operations from being performed on the container\n     * once it has entered a disposed state.\n     *\n     * @remarks\n     * Due to its extensive usage throughout container methods, this method name\n     * is mangled in minified builds.  As such, the existence of this method should\n     * not be assumed by consumers of the private interface.\n     */\n    throwIfDisposed() {\n        if (this.disposed) {\n            // TODO: Use custom error.\n            throw NativeError(__CANNOT_USE_CONTAINER_AFTER_IT_HAS_BEEN_DISPOSED);\n        }\n    }\n    /**\n     * Gets the value belonging to passed in {@link ServiceMetadata} instance.\n     *\n     * @remarks\n     * - If {@link ServiceMetadata.value | serviceMetadata.value} is present, it is immediately returned.\n     * - Alternatively, the requested type is resolved to the appropriate value,\n     * which is then saved to {@link ServiceMetadata.value | 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            throw 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 a factory is provided, we pass it an array containing the service identifiers the\n             * service declared as its dependencies.\n             *\n             * One aspect of note, when compared to standard services, is that we treat built-in\n             * dependencies a bit differently: instead of throwing an error, the built-in constructor\n             * itself is passed to the factory function.\n             *\n             * As an example:\n             * ```ts\n             * @Service([Number, MyOtherService], {\n             *   factory: (container, id, [{ id: number }, { id: myOtherService }]) => {\n             *     assert(number === Number);\n             *     assert(myOtherService === MyOtherService);\n             *   }\n             * })\n             * class MyService { }\n             * ```\n             *\n             * Without a factory, this would cause an error, as TypeDI would be unable to resolve \"Number\".\n             * However, we assume that the factory knows the service's dependencies ahead of time, and\n             * therefore the declaration of a built-in dependency is just for type-checking.\n             *\n             * The dependencies of the service are passed as objects (using C++ lingo, rvalues) that\n             * include both the ID of the dependency alongside its declared constraints, if any.\n             * One important note is that the dependency *itself* is never resolved in the container.\n             */\n            const parameters = serviceMetadata.dependencies.map(resolvable => ({\n                id: this.resolveTypeWrapper(resolvable.typeWrapper),\n                constraints: resolvable.constraints,\n            }));\n            /**\n             * If we received the factory in the [Constructable<Factory>, \"functionName\"] format,\n             * we need to create the factory first and then call the specified function on it.\n             *\n             * One aspect of the implementation worthy of mention is that we pass a few arguments\n             * to the factory function (or method) declared.\n             * Currently, the arguments are as follows:\n             *   - A reference to the {@link ContainerInstance} that the service is running under.\n             *   - The {@link ServiceIdentifier} of the newly-created service.\n             *   - The declared dependencies of the service.\n             */\n            if (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, parameters);\n            }\n            else {\n                /** If only a simple function was provided we simply call it. */\n                value = factoryMeta(this, serviceMetadata.id, parameters);\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            /**\n             * If no factory was provided, we resolve the parameters and set the\n             * `guardBuiltIns` parameter to `true`.  This makes the resolver throw\n             * if it encounters a reference to a built-in constructor.\n             *\n             * @see {@link CannotInstantiateBuiltInError}\n             */\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            throw new CannotInstantiateValueError(serviceMetadata.id);\n        }\n        return value;\n    }\n    getConstructorParameters({ dependencies }, guardBuiltIns) {\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(resolvable => this.resolveResolvable(resolvable, guardBuiltIns));\n    }\n    /**\n     * Resolve a {@link Resolvable} object in the current container.\n     *\n     * @param resolvable The {@link Resolvable} to resolve.\n     *\n     * @returns The resolved value of the item.\n     */\n    resolveResolvable(resolvable, guardBuiltIns) {\n        const { typeWrapper } = resolvable;\n        const identifier = this.resolveTypeWrapper(resolvable.typeWrapper);\n        /**\n         * The type wrapper resolver doesn't check if the identifier\n         * is a built-in (Number, String, etc.).\n         */\n        if (BUILT_INS.includes(identifier)) {\n            if (guardBuiltIns) {\n                throw new CannotInstantiateBuiltInError(identifier.name);\n            }\n            /**\n             * If we're sure that it's a built-in and we've been told not to\n             * guard instantiation of built-ins, return the built-in constructor\n             * here as going any further would result in runtime errors.\n             */\n            return identifier;\n        }\n        const { constraints } = resolvable;\n        /**\n         * We now have to deal with a special type of TypeWrapper, called an extractable one.\n         * These ones are able to completely bypass the ordinary parameter resolution process,\n         * allowing them to supply custom values to a service upon construction.\n         *\n         * As can be seen below, an extractable TypeWrapper is able to either completely\n         * disregard the Resolution Constraints used, or cater to them in unique, domain-specific\n         * ways.\n         *\n         * It should also be noted that, in the case of an extractable TypeWrapper,\n         * the specified constraints are not validated.\n         *\n         * Such examples of this can be seen in {@link TransientRef}, or {@link Lazy}.\n         */\n        const isTypeWrapperExtractable = 'extract' in typeWrapper;\n        if (isTypeWrapperExtractable) {\n            /**\n             * We use a non-null assertion here because using the nullish operator\n             * would induce additional runtime cost. As we've done the `in` check\n             * above, we don't need to guard access to this member.\n             */\n            // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n            return typeWrapper.extract(this, constraints ?? 0 /* ResolutionConstraintFlag.None */);\n        }\n        if (constraints) {\n            /**\n             * If the type-wrapper is not extractable, we continue with the usual behaviour,\n             * wherein the container itself resolves the value of the identifier, taking all\n             * specified constraints into account in the process of resolution.\n             */\n            return this.resolveConstrainedIdentifier(identifier, constraints);\n        }\n        /** If no constraints were found, fallback to default behaviour. */\n        return this.get(identifier);\n    }\n    /**\n     * Resolve an identifier within the context of the current container,\n     * alongside a specific set of resolution constraints specified by the end-user.\n     *\n     * @param identifier The identifier to resolve.\n     *\n     * @param constraints The constraints to take into consideration\n     * while resolving the specified identifier.\n     *\n     * @remarks\n     * If {@link SkipSelf} is specified, the parent of this container is used to resolve the identifier.\n     *\n     * @remarks\n     * In the case of {@link Optional}, if the identifier cannot be found,\n     * \"null\" is returned instead.  This is in-line with the specification.\n     *\n     * @returns The result of resolving the value within the current container.\n     *\n     * @see {@link ResolutionConstraintFlag}\n     *\n     * @throws {@link ServiceNotFoundError}\n     * This exception is thrown if an invalid identifier is provided, and the\n     * {@link Optional} flag has not been provided.\n     *\n     * @throws Error\n     * This exception is thrown if the {@link SkipSelf} constraint has been specified,\n     * but the current container does not have a parent.\n     *\n     * @throws Error\n     * This exception is thrown if {@link SkipSelf} and {@link Self} are used at the same time.\n     */\n    resolveConstrainedIdentifier(identifier, constraints) {\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        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            throw NativeError('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            throw NativeError(`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;\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 NativeNull;\n            }\n            throw new ServiceNotFoundError(identifier);\n        }\n        if (isMany) {\n            /** If we're in isMany mode, resolve the identifier via `getMany`. */\n            return targetContainer.getMany(identifier, recursive);\n        }\n        else {\n            return targetContainer.get(identifier, recursive);\n        }\n    }\n    resolveTypeWrapper(wrapper) {\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        /**\n         * This should never be hit unless the caller has elided TypeScript\n         * and hand-crafted a TypeWrapper, which is not recommended.\n         */\n        /* istanbul ignore next */\n        if (resolved == NativeNull) {\n            throw NativeError(`The wrapped value could not be 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     * Check if the given service is able to be destroyed and, if so, destroys it in-place.\n     * @deprecated\n     *\n     * @remarks\n     * If the service contains a method named `destroy`, it is called.\n     * However, the value it returns 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.throwIfDisposed();\n        const { value, type, factory } = serviceMetadata;\n        /** We reset value only if we can re-create it (aka type or factory exists). */\n        const shouldResetValue = force || !!type || !!factory;\n        if (shouldResetValue) {\n            /** If we wound a function named destroy we call it without any params. */\n            if (typeof value?.['dispose'] === 'function') {\n                try {\n                    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    /**\n     * Add a visitor to the container.\n     * @experimental\n     *\n     * @param visitor The visitor to add to this container.\n     *\n     * @see {@link ContainerTreeVisitor}\n     *\n     * @returns Whether the operation was successful.\n     */\n    acceptTreeVisitor(visitor) {\n        this.throwIfDisposed();\n        return this.visitor.addVisitorToCollection(visitor, this);\n    }\n    /**\n     * Remove a visitor from the container.\n     * No-op if the visitor was never attached to the container.\n     * @experimental\n     *\n     * @param visitor The visitor to remove from the container.\n     *\n     * @see {@link ContainerTreeVisitor}\n     *\n     * @returns Whether the operation was successful.\n     */\n    detachTreeVisitor(visitor) {\n        this.throwIfDisposed();\n        return this.visitor.removeVisitorFromCollection(visitor);\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 = (defaultContainer = new ContainerInstance('default'));\n/**\n * Keep a reference to the default container which we then utilise\n * in {@link ContainerInstance}.  This reduces the final size of the bundle,\n * as we are referencing a static variable instead of continuously\n * looking up a property.\n */\nexport { defaultContainer };\n/**\n * Register the default container in ContainerRegistry.\n * We don't use `ContainerInstance.of` here as we don't need to check\n * if a container with the \"default\" ID already exists: it never will.\n */\nContainerRegistry.registerContainer(defaultContainer);\n//# sourceMappingURL=container-instance.class.mjs.map","import { defaultContainer } from '../container-instance.class.mjs';\nimport { SERVICE_METADATA_DEFAULTS } from '../constants/service-defaults.const.mjs';\nimport { wrapDependencyAsResolvable } from '../utils/wrap-resolvable-dependency.mjs';\nimport { isArray } from '../utils/is-array.util.mjs';\nimport { NativeError } from '../constants/minification/native-error.const.mjs';\nimport { NativeNull } from '../constants/minification/native-null.const.mjs';\nexport function Service(optionsOrDependencies, maybeDependencies) {\n    return targetConstructor => {\n        if (optionsOrDependencies == NativeNull || targetConstructor == NativeNull) {\n            throw NativeError('The @Service decorator was not used correctly.');\n        }\n        /** A list of dependencies resolved from the arguments provided to the function. */\n        let resolvedDependencies;\n        const optionsOrDependenciesIsArray = isArray(optionsOrDependencies);\n        if (optionsOrDependenciesIsArray) {\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 (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            throw NativeError('The dependencies provided were not able to be resolved.');\n        }\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        const metadata = {\n            id: targetConstructor,\n            type: targetConstructor,\n            ...SERVICE_METADATA_DEFAULTS,\n            container: defaultContainer,\n        };\n        if (!optionsOrDependenciesIsArray) {\n            Object.assign(metadata, optionsOrDependencies);\n        }\n        const wrappedDependencies = resolvedDependencies.map((dependency, index) => wrapDependencyAsResolvable(dependency, metadata, index));\n        const { id, container } = metadata;\n        /**\n         * If the target is already registered, `@Service` may have been called twice on the same class.\n         * Alternatively, the consumer may be trying to override a well-known key in the container.\n         *\n         * Not throwing here may lead to confusion as, in the case of duplicate calls to `@Service` referencing\n         * the same identifier, the \"winning\" implementation which is *actually* used may be unclear.\n         *\n         * We disable recursiveness in the check here to allow for sub-containers to override well-known\n         * IDs in parent containers.\n         * This makes it easier to immutably extend containers in-place by way of sub-containers.\n         *\n         * One final note: It's also very important to ensure that the duplication checks are *not* performed\n         * if the `multiple` bit is set to true.  In that case, we'd very much want it to function like an\n         * ordinary `Container.set` call, wherein the same operation would result in this service being added\n         * to an internal array of values for the specified identifier.\n         */\n        if (container.has(id, false) && !metadata.multiple) {\n            throw NativeError(`@Service() has been called twice upon ${targetConstructor.name}, or you have used an ID twice.`);\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.mjs.map","import { NativeError } from '../constants/minification/native-error.const.mjs';\nimport { Service } from './service.decorator.mjs';\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        throw NativeError('The JSService overload was not used correctly.');\n    }\n    return constructor;\n}\n//# sourceMappingURL=js-service.decorator.mjs.map","import { HOST_CONTAINER } from '../constants/host-container.const.mjs';\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 const HostContainer = () => HOST_CONTAINER;\n//# sourceMappingURL=host-container.function.mjs.map","import { TYPE_WRAPPER } from '../constants/type-wrapper.const.mjs';\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 {\n        [TYPE_WRAPPER]: 0 /* TypeWrapperStamp.Generic */,\n        lazyType: fn,\n        /**\n         * Because extractable type-wrappers are able to completely override the resolution process,\n         * we need to ensure that we resolve the constrained identifier directly in the container.\n         *\n         * To do this, the previous constraint resolution method was modularized, with the core resolution\n         * process extracted into a new method.  This lets us call it from type-wrappers.\n         */\n        extract: (container, constraints) => container.resolveConstrainedIdentifier(fn(), constraints),\n    };\n}\n//# sourceMappingURL=lazy.function.mjs.map","/**\n * If the identifier cannot be found, substitute it with `null`.\n * @experimental\n *\n * The constraints supported are listed in {@link 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 * @example\n * Here is an example of this constraint as part of a service declaration:\n * ```ts\n * const NAME = new Token<string>();\n *\n * @Service([\n *   [NAME, Optional()]\n * ])\n * class MyService {\n *   constructor (private name: string | null) {\n *     // If \"NAME\" isn't provided in the container the service is run under,\n *     // it will be substituted with null.  Note that the container may not\n *     // be the exact one it was declared under, but a descendent.\n *   }\n * }\n * ```\n *\n * @group Resolution Constraints\n *\n * @see {@link ResolutionConstraintFlag}\n *\n * @group Resolution Constraints\n *\n * @returns The resolution constraint bit-flag for Optional.\n */\nexport const Optional = () => 2 /* ResolutionConstraintFlag.Optional */;\n/**\n * Do not ascend the container tree to resolve this identifier.\n * @experimental\n *\n * The constraints supported are listed in {@link 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 * @example\n * Here is an example of this constraint as part of a service declaration:\n * ```ts\n * const NAME = new Token<string>('name');\n * const childContainer = Container.ofChild(Symbol());\n *\n * @Service({ container: childContainer }, [\n *   [NAME, Self()]\n * ])\n * class MyService {\n *   constructor (private name: string) { }\n * }\n *\n * Container.set({ id: NAME, value: 'Joanna' });\n *\n * childContainer.get(MyService);\n * // -> throws ServiceNotFoundError(Token<name>)\n * ```\n *\n * @remarks\n * It is advised to combine this with {@link Optional}, as the usage of this\n * constraint may mean that the identifier cannot be resolved.\n *\n * @group Resolution Constraints\n *\n * @see {@link ResolutionConstraintFlag}\n *\n * @group Resolution Constraints\n *\n * @returns The resolution constraint bit-flag for Self.\n */\nexport const Self = () => 8 /* ResolutionConstraintFlag.Self */;\n/**\n * Begin searching from the parent container to resolve this identifier.\n * @experimental\n *\n * The constraints supported are listed in {@link 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 * @example\n * Here is an example of this constraint as part of a service declaration:\n * ```ts\n * const NAME = new Token<string>('name');\n * const childContainer = Container.ofChild(Symbol());\n *\n * @Service({ container: childContainer }, [\n *   [NAME, SkipSelf()]\n * ])\n * class MyService {\n *   constructor (private name: string) {\n *     // In this example, $name would evaluate to Joanna instead\n *     // of Mike.  This is due to the SkipSelf decorator.\n *   }\n * }\n *\n * childContainer.set({ id: NAME, value: 'Mike' });\n * Container.set({ id: NAME, value: 'Joanna' });\n *\n * childContainer.get(MyService);\n * ```\n *\n * @see {@link ResolutionConstraintFlag}\n *\n * @group Resolution Constraints\n *\n * @returns The resolution constraint bit-flag for SkipSelf.\n */\nexport const SkipSelf = () => 4 /* ResolutionConstraintFlag.SkipSelf */;\n/**\n * Resolve multiple services for this identifier via `getMany`.\n * @experimental\n *\n * The constraints supported are listed in {@link 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 * @see {@link ResolutionConstraintFlag}\n *\n * @group Resolution Constraints\n *\n * @returns The resolution constraint bit-flag for SkipSelf.\n */\nexport const Many = () => 1 /* ResolutionConstraintFlag.Many */;\n//# sourceMappingURL=resolution-constraints.functions.mjs.map"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,WAAW,GAAG,KAAK;;ACNhC;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pB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,OAAO,EAAE,CAAC,SAAS,EAAE,WAAW,KAAK,SAAS,CAAC,4BAA4B,CAAC,EAAE,EAAE,EAAE,WAAW,CAAC;AACtG,KAAK,CAAC;AACN;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,QAAQ,GAAG,MAAM,CAAC,yCAAyC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,IAAI,GAAG,MAAM,CAAC,qCAAqC;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,QAAQ,GAAG,MAAM,CAAC,yCAAyC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,IAAI,GAAG,MAAM,CAAC;;;;"}