@inversifyjs/core 7.0.0 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/lib/cjs/binding/models/BindingConstraintsImplementation.d.ts +2 -2
- package/lib/cjs/common/models/SingleImmutableLinkedList.d.ts +11 -0
- package/lib/cjs/common/models/{SingleInmutableLinkedList.d.ts.map → SingleImmutableLinkedList.d.ts.map} +1 -1
- package/lib/cjs/common/models/{SingleInmutableLinkedList.js → SingleImmutableLinkedList.js} +5 -5
- package/lib/cjs/common/models/{SingleInmutableLinkedList.js.map → SingleImmutableLinkedList.js.map} +1 -1
- package/lib/cjs/common/models/SingleImmutableLinkedList.spec.d.ts +2 -0
- package/lib/cjs/common/models/SingleImmutableLinkedList.spec.d.ts.map +1 -0
- package/lib/cjs/index.d.ts +6 -2
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js +3 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/metadata/decorators/injectFromHierarchy.d.ts +3 -0
- package/lib/cjs/metadata/decorators/injectFromHierarchy.d.ts.map +1 -0
- package/lib/cjs/metadata/decorators/injectFromHierarchy.js +22 -0
- package/lib/cjs/metadata/decorators/injectFromHierarchy.js.map +1 -0
- package/lib/cjs/metadata/decorators/injectFromHierarchy.spec.d.ts +2 -0
- package/lib/cjs/metadata/decorators/injectFromHierarchy.spec.d.ts.map +1 -0
- package/lib/cjs/metadata/models/InjectFromHierarchyOptions.d.ts +5 -0
- package/lib/cjs/metadata/models/InjectFromHierarchyOptions.d.ts.map +1 -0
- package/lib/cjs/metadata/models/InjectFromHierarchyOptions.js +3 -0
- package/lib/cjs/metadata/models/InjectFromHierarchyOptions.js.map +1 -0
- package/lib/cjs/planning/actions/addServiceNodeBindingIfContextFree.d.ts +2 -2
- package/lib/cjs/planning/actions/addServiceNodeBindingIfContextFree.d.ts.map +1 -1
- package/lib/cjs/planning/actions/addServiceNodeBindingIfContextFree.js +29 -1
- package/lib/cjs/planning/actions/addServiceNodeBindingIfContextFree.js.map +1 -1
- package/lib/cjs/planning/actions/curryBuildPlanServiceNode.d.ts +2 -2
- package/lib/cjs/planning/actions/curryBuildPlanServiceNodeFromClassElementMetadata.d.ts +2 -2
- package/lib/cjs/planning/actions/curryBuildPlanServiceNodeFromResolvedValueElementMetadata.d.ts +2 -2
- package/lib/cjs/planning/actions/curryBuildServiceNodeBindings.d.ts +2 -2
- package/lib/cjs/planning/actions/curryLazyBuildPlanServiceNodeFromClassElementMetadata.d.ts +2 -2
- package/lib/cjs/planning/actions/curryLazyBuildPlanServiceNodeFromResolvedValueElementMetadata.d.ts +2 -2
- package/lib/cjs/planning/actions/currySubplan.d.ts +2 -2
- package/lib/cjs/planning/actions/plan.d.ts +3 -3
- package/lib/cjs/planning/actions/removeServiceNodeBindingIfContextFree.d.ts +2 -2
- package/lib/cjs/planning/calculations/buildPlanBindingConstraintsList.d.ts +2 -2
- package/lib/cjs/planning/calculations/buildPlanBindingConstraintsList.js +2 -2
- package/lib/cjs/planning/calculations/checkPlanServiceRedirectionBindingNodeSingleInjectionBindings.d.ts +2 -2
- package/lib/cjs/planning/calculations/checkServiceNodeSingleInjectionBindings.d.ts +2 -2
- package/lib/cjs/planning/calculations/handleResolveError.d.ts +3 -0
- package/lib/cjs/planning/calculations/handleResolveError.d.ts.map +1 -0
- package/lib/cjs/planning/calculations/handleResolveError.js +101 -0
- package/lib/cjs/planning/calculations/handleResolveError.js.map +1 -0
- package/lib/cjs/planning/calculations/handleResolveError.spec.d.ts +2 -0
- package/lib/cjs/planning/calculations/handleResolveError.spec.d.ts.map +1 -0
- package/lib/cjs/planning/calculations/throwErrorWhenUnexpectedBindingsAmountFound.d.ts +2 -2
- package/lib/cjs/planning/models/NonCachedServiceNodeContext.d.ts +2 -2
- package/lib/cjs/resolution/actions/resolve.d.ts.map +1 -1
- package/lib/cjs/resolution/actions/resolve.js +8 -2
- package/lib/cjs/resolution/actions/resolve.js.map +1 -1
- package/lib/esm/index.d.ts +22 -9
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/index.js.map +1 -1
- package/package.json +4 -4
- package/lib/cjs/common/models/SingleInmutableLinkedList.d.ts +0 -11
- package/lib/cjs/common/models/SingleInmutableLinkedList.spec.d.ts +0 -2
- package/lib/cjs/common/models/SingleInmutableLinkedList.spec.d.ts.map +0 -1
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleResolveError = handleResolveError;
|
|
4
|
+
const common_1 = require("@inversifyjs/common");
|
|
5
|
+
const BindingType_1 = require("../../binding/models/BindingType");
|
|
6
|
+
const isStackOverflowError_1 = require("../../error/calculations/isStackOverflowError");
|
|
7
|
+
const InversifyCoreError_1 = require("../../error/models/InversifyCoreError");
|
|
8
|
+
const InversifyCoreErrorKind_1 = require("../../error/models/InversifyCoreErrorKind");
|
|
9
|
+
const isPlanServiceRedirectionBindingNode_1 = require("./isPlanServiceRedirectionBindingNode");
|
|
10
|
+
const INDEX_NOT_FOUND = -1;
|
|
11
|
+
function handleResolveError(params, error) {
|
|
12
|
+
if ((0, isStackOverflowError_1.isStackOverflowError)(error)) {
|
|
13
|
+
const stringifiedCircularDependencies = stringifyServiceIdentifierTrace(extractLikelyCircularDependency(params));
|
|
14
|
+
throw new InversifyCoreError_1.InversifyCoreError(InversifyCoreErrorKind_1.InversifyCoreErrorKind.planning, `Circular dependency found: ${stringifiedCircularDependencies}`, { cause: error });
|
|
15
|
+
}
|
|
16
|
+
throw error;
|
|
17
|
+
}
|
|
18
|
+
function extractLikelyCircularDependency(params) {
|
|
19
|
+
const root = params.planResult.tree.root;
|
|
20
|
+
const stack = [];
|
|
21
|
+
function depthFirstSearch(node) {
|
|
22
|
+
const existingIndex = stack.indexOf(node);
|
|
23
|
+
if (existingIndex !== INDEX_NOT_FOUND) {
|
|
24
|
+
const cycleNodes = [
|
|
25
|
+
...stack.slice(existingIndex),
|
|
26
|
+
node,
|
|
27
|
+
];
|
|
28
|
+
return cycleNodes.map((n) => n.serviceIdentifier);
|
|
29
|
+
}
|
|
30
|
+
stack.push(node);
|
|
31
|
+
try {
|
|
32
|
+
for (const child of getChildServiceNodes(node)) {
|
|
33
|
+
const result = depthFirstSearch(child);
|
|
34
|
+
if (result !== undefined) {
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
finally {
|
|
40
|
+
stack.pop();
|
|
41
|
+
}
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
const result = depthFirstSearch(root);
|
|
45
|
+
return result ?? [];
|
|
46
|
+
}
|
|
47
|
+
function getChildServiceNodes(serviceNode) {
|
|
48
|
+
const children = [];
|
|
49
|
+
const bindings = serviceNode.bindings;
|
|
50
|
+
if (bindings === undefined) {
|
|
51
|
+
return children;
|
|
52
|
+
}
|
|
53
|
+
const processBindingNode = (bindingNode) => {
|
|
54
|
+
if ((0, isPlanServiceRedirectionBindingNode_1.isPlanServiceRedirectionBindingNode)(bindingNode)) {
|
|
55
|
+
for (const redirection of bindingNode.redirections) {
|
|
56
|
+
processBindingNode(redirection);
|
|
57
|
+
}
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
switch (bindingNode.binding.type) {
|
|
61
|
+
case BindingType_1.bindingTypeValues.Instance: {
|
|
62
|
+
const instanceNode = bindingNode;
|
|
63
|
+
for (const ctorParam of instanceNode.constructorParams) {
|
|
64
|
+
if (ctorParam !== undefined) {
|
|
65
|
+
children.push(ctorParam);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
for (const propParam of instanceNode.propertyParams.values()) {
|
|
69
|
+
children.push(propParam);
|
|
70
|
+
}
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
case BindingType_1.bindingTypeValues.ResolvedValue: {
|
|
74
|
+
const resolvedValueNode = bindingNode;
|
|
75
|
+
for (const param of resolvedValueNode.params) {
|
|
76
|
+
children.push(param);
|
|
77
|
+
}
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
default:
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
if (Array.isArray(bindings)) {
|
|
85
|
+
for (const bindingNode of bindings) {
|
|
86
|
+
processBindingNode(bindingNode);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
processBindingNode(bindings);
|
|
91
|
+
}
|
|
92
|
+
return children;
|
|
93
|
+
}
|
|
94
|
+
function stringifyServiceIdentifierTrace(serviceIdentifiers) {
|
|
95
|
+
const serviceIdentifiersArray = [...serviceIdentifiers];
|
|
96
|
+
if (serviceIdentifiersArray.length === 0) {
|
|
97
|
+
return '(No dependency trace)';
|
|
98
|
+
}
|
|
99
|
+
return serviceIdentifiersArray.map(common_1.stringifyServiceIdentifier).join(' -> ');
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=handleResolveError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleResolveError.js","sourceRoot":"","sources":["../../../../src/planning/calculations/handleResolveError.ts"],"names":[],"mappings":";;AAkBA,gDAgBC;AAlCD,gDAG6B;AAE7B,kEAAqE;AACrE,wFAAqF;AACrF,8EAA2E;AAC3E,sFAAmF;AAMnF,+FAA4F;AAE5F,MAAM,eAAe,GAAW,CAAC,CAAC,CAAC;AAEnC,SAAgB,kBAAkB,CAChC,MAAwB,EACxB,KAAc;IAEd,IAAI,IAAA,2CAAoB,EAAC,KAAK,CAAC,EAAE,CAAC;QAChC,MAAM,+BAA+B,GACnC,+BAA+B,CAAC,+BAA+B,CAAC,MAAM,CAAC,CAAC,CAAC;QAE3E,MAAM,IAAI,uCAAkB,CAC1B,+CAAsB,CAAC,QAAQ,EAC/B,8BAA8B,+BAA+B,EAAE,EAC/D,EAAE,KAAK,EAAE,KAAK,EAAE,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AC;QACN,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,+BAA+B,CACtC,kBAA+C;IAE/C,MAAM,uBAAuB,GAAwB,CAAC,GAAG,kBAAkB,CAAC,CAAC;IAE7E,IAAI,uBAAuB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzC,OAAO,uBAAuB,CAAC;IACjC,CAAC;IAED,OAAO,uBAAuB,CAAC,GAAG,CAAC,mCAA0B,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC9E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleResolveError.spec.d.ts","sourceRoot":"","sources":["../../../../src/planning/calculations/handleResolveError.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ServiceIdentifier } from '@inversifyjs/common';
|
|
2
2
|
import { InternalBindingConstraints } from '../../binding/models/BindingConstraintsImplementation';
|
|
3
|
-
import {
|
|
3
|
+
import { SingleImmutableLinkedListNode } from '../../common/models/SingleImmutableLinkedList';
|
|
4
4
|
import { PlanBindingNode } from '../models/PlanBindingNode';
|
|
5
|
-
export declare function throwErrorWhenUnexpectedBindingsAmountFound(bindingNodes: PlanBindingNode[] | PlanBindingNode | undefined, isOptional: boolean, bindingConstraintNode:
|
|
5
|
+
export declare function throwErrorWhenUnexpectedBindingsAmountFound(bindingNodes: PlanBindingNode[] | PlanBindingNode | undefined, isOptional: boolean, bindingConstraintNode: SingleImmutableLinkedListNode<InternalBindingConstraints>, serviceRedirections: readonly ServiceIdentifier[]): void;
|
|
6
6
|
//# sourceMappingURL=throwErrorWhenUnexpectedBindingsAmountFound.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InternalBindingConstraints } from '../../binding/models/BindingConstraintsImplementation';
|
|
2
|
-
import {
|
|
2
|
+
import { SingleImmutableLinkedList } from '../../common/models/SingleImmutableLinkedList';
|
|
3
3
|
export interface NonCachedServiceNodeContext {
|
|
4
|
-
bindingConstraintsList:
|
|
4
|
+
bindingConstraintsList: SingleImmutableLinkedList<InternalBindingConstraints>;
|
|
5
5
|
chainedBindings: boolean;
|
|
6
6
|
optionalBindings: boolean;
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../../src/resolution/actions/resolve.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../../src/resolution/actions/resolve.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAuE9D,wBAAgB,OAAO,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAQzD"}
|
|
@@ -5,6 +5,7 @@ const common_1 = require("@inversifyjs/common");
|
|
|
5
5
|
const BindingType_1 = require("../../binding/models/BindingType");
|
|
6
6
|
const InversifyCoreError_1 = require("../../error/models/InversifyCoreError");
|
|
7
7
|
const InversifyCoreErrorKind_1 = require("../../error/models/InversifyCoreErrorKind");
|
|
8
|
+
const handleResolveError_1 = require("../../planning/calculations/handleResolveError");
|
|
8
9
|
const isPlanServiceRedirectionBindingNode_1 = require("../../planning/calculations/isPlanServiceRedirectionBindingNode");
|
|
9
10
|
const resolveConstantValueBinding_1 = require("./resolveConstantValueBinding");
|
|
10
11
|
const resolveDynamicValueBinding_1 = require("./resolveDynamicValueBinding");
|
|
@@ -31,8 +32,13 @@ const resolveResolvedValueBindingNode = (0, resolveResolvedValueBindingNode_1.re
|
|
|
31
32
|
const resolveScopedInstanceBindingNode = (0, resolveScopedInstanceBindingNode_1.resolveScopedInstanceBindingNode)(resolveInstanceBindingNode);
|
|
32
33
|
const resolveScopedResolvedValueBindingNode = (0, resolveScopedResolvedValueBindingNode_1.resolveScopedResolvedValueBindingNode)(resolveResolvedValueBindingNode);
|
|
33
34
|
function resolve(params) {
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
try {
|
|
36
|
+
const serviceNode = params.planResult.tree.root;
|
|
37
|
+
return resolveServiceNode(params, serviceNode);
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
(0, handleResolveError_1.handleResolveError)(params, error);
|
|
41
|
+
}
|
|
36
42
|
}
|
|
37
43
|
function resolveBindingNode(params, planBindingNode) {
|
|
38
44
|
switch (planBindingNode.binding.type) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../../../src/resolution/actions/resolve.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../../../src/resolution/actions/resolve.ts"],"names":[],"mappings":";;AAuFA,0BAQC;AA/FD,gDAAgD;AAEhD,kEAAqE;AAGrE,8EAA2E;AAC3E,sFAAmF;AACnF,uFAAoF;AACpF,yHAAsH;AAUtH,+EAA4E;AAC5E,6EAA0E;AAC1E,mEAAgE;AAChE,uGAAoJ;AACpJ,6EAA6G;AAC7G,iIAA8H;AAC9H,uHAAoH;AACpH,qEAAkE;AAClE,uFAA4H;AAC5H,2FAAkI;AAClI,yFAA+H;AAC/H,mGAA8I;AAC9I,iGAA2I;AAC3I,mEAA8F;AAE9F,MAAM,qBAAqB,GAIC,IAAA,6CAA0B,EAAC,kBAAkB,CAAC,CAAC;AAE3E,MAAM,oCAAoC,GAGzB,IAAA,2EAAyC,EAAC,kBAAkB,CAAC,CAAC;AAE/E,MAAM,0BAA0B,GAOJ,IAAA,uDAA+B;AACzD,8DAA8D;AAC9D,IAAA,iFAA4C,EAAM,kBAAkB,CAAC,EACrE,IAAA,2GAAoD,EAClD,IAAA,iGAA+C,EAAC,qBAAqB,CAAC,CACvE,EACD,IAAA,iGAA+C,EAAC,qBAAqB,CAAC,CACvE,CAAC;AAEF,MAAM,+BAA+B,GAQT,IAAA,iEAAoC;AAC9D,8DAA8D;A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AM,IAAI,uCAAkB,CAC1B,+CAAsB,CAAC,UAAU,EACjC,yDAAyD,CAC1D,CAAC;QACJ,CAAC;IACH,CAAC;SAAM,CAAC;QACN,OAAO,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC"}
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -251,6 +251,13 @@ interface InjectFromBaseOptions {
|
|
|
251
251
|
|
|
252
252
|
declare function injectFromBase(options?: InjectFromBaseOptions): ClassDecorator;
|
|
253
253
|
|
|
254
|
+
interface InjectFromHierarchyOptions {
|
|
255
|
+
extendConstructorArguments?: boolean | undefined;
|
|
256
|
+
extendProperties?: boolean | undefined;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
declare function injectFromHierarchy(options?: InjectFromHierarchyOptions): ClassDecorator;
|
|
260
|
+
|
|
254
261
|
interface MultiInjectOptions {
|
|
255
262
|
chained?: boolean;
|
|
256
263
|
}
|
|
@@ -269,14 +276,20 @@ declare function tagged(key: MetadataTag, value: unknown): MethodDecorator & Par
|
|
|
269
276
|
|
|
270
277
|
declare function unmanaged(): MethodDecorator & ParameterDecorator & PropertyDecorator;
|
|
271
278
|
|
|
272
|
-
interface
|
|
279
|
+
interface InjectFromOptions {
|
|
280
|
+
extendConstructorArguments?: boolean | undefined;
|
|
281
|
+
extendProperties?: boolean | undefined;
|
|
282
|
+
type: Newable;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
interface SingleImmutableLinkedListNode<T> {
|
|
273
286
|
elem: T;
|
|
274
|
-
previous:
|
|
287
|
+
previous: SingleImmutableLinkedListNode<T> | undefined;
|
|
275
288
|
}
|
|
276
|
-
declare class
|
|
277
|
-
readonly last:
|
|
278
|
-
constructor(last:
|
|
279
|
-
concat(elem: T):
|
|
289
|
+
declare class SingleImmutableLinkedList<T> implements Iterable<T> {
|
|
290
|
+
readonly last: SingleImmutableLinkedListNode<T>;
|
|
291
|
+
constructor(last: SingleImmutableLinkedListNode<T>);
|
|
292
|
+
concat(elem: T): SingleImmutableLinkedList<T>;
|
|
280
293
|
[Symbol.iterator](): Iterator<T>;
|
|
281
294
|
}
|
|
282
295
|
|
|
@@ -315,7 +328,7 @@ interface GetSingleServicePlanOptions extends BaseGetPlanOptions {
|
|
|
315
328
|
type GetPlanOptions = GetSingleServicePlanOptions | GetMultipleServicePlanOptions;
|
|
316
329
|
|
|
317
330
|
interface NonCachedServiceNodeContext {
|
|
318
|
-
bindingConstraintsList:
|
|
331
|
+
bindingConstraintsList: SingleImmutableLinkedList<InternalBindingConstraints>;
|
|
319
332
|
chainedBindings: boolean;
|
|
320
333
|
optionalBindings: boolean;
|
|
321
334
|
}
|
|
@@ -466,5 +479,5 @@ interface OptionalGetAllOptions extends GetAllOptions {
|
|
|
466
479
|
optional: true;
|
|
467
480
|
}
|
|
468
481
|
|
|
469
|
-
export { ActivationsService, BindingService, CacheBindingInvalidationKind, ClassElementMetadataKind, DeactivationsService, PlanResultCacheService, ResolvedValueElementMetadataKind, bindingScopeValues, bindingTypeValues, decorate, getBindingId, getClassMetadata, inject, injectFromBase, injectable, multiInject, named, optional, plan, postConstruct, preDestroy, resolve, resolveBindingsDeactivations, resolveModuleDeactivations, resolveServiceDeactivations, tagged, unmanaged };
|
|
470
|
-
export type { BaseBinding, BaseBindingNode, BaseGetPlanOptions, BaseManagedClassElementMetadata, BasePlanParams, Binding, BindingActivation, BindingActivationRelation, BindingConstraints, BindingDeactivation, BindingDeactivationRelation, BindingScope, BindingType, CacheBindingInvalidation, ClassElementMetadata, ClassMetadata, ClassMetadataLifecycle, ConstantValueBinding, DeactivationParams, DynamicValueBinding, DynamicValueBuilder, Factory, FactoryBinding, GetAllOptions, GetMultipleServicePlanOptions, GetOptions, GetOptionsTagConstraint, GetPlanOptions, GetPlanOptionsTagConstraint, GetSingleServicePlanOptions, InstanceBinding, InstanceBindingNode, LeafBindingNode, ManagedClassElementMetadata, MetadataName, MetadataTag, MultiInjectOptions, MultipleBindingPlanParamsConstraint, MultipleInjectionManagedClassElementMetadata, MultipleInjectionResolvedValueElementMetadata, NonCachedServiceNodeContext, OptionalGetAllOptions, OptionalGetOptions, PlanBindingNode, PlanParams, PlanParamsConstraint, PlanParamsOperations, PlanParamsTagConstraint, PlanResult, PlanServiceNode, PlanServiceNodeParent, PlanServiceRedirectionBindingNode, PlanTree, Provider, ProviderBinding, ResolutionContext, ResolutionParams, Resolved, ResolvedValueBinding, ResolvedValueBindingNode, ResolvedValueElementMetadata, ResolvedValueMetadata, ScopedBinding, ServiceRedirectionBinding, SingleBindingPlanParamsConstraint, SingleInjectionManagedClassElementMetadata, SingleInjectionResolvedValueElementMetadata, UnmanagedClassElementMetadata };
|
|
482
|
+
export { ActivationsService, BindingService, CacheBindingInvalidationKind, ClassElementMetadataKind, DeactivationsService, PlanResultCacheService, ResolvedValueElementMetadataKind, bindingScopeValues, bindingTypeValues, decorate, getBindingId, getClassMetadata, inject, injectFromBase, injectFromHierarchy, injectable, multiInject, named, optional, plan, postConstruct, preDestroy, resolve, resolveBindingsDeactivations, resolveModuleDeactivations, resolveServiceDeactivations, tagged, unmanaged };
|
|
483
|
+
export type { BaseBinding, BaseBindingNode, BaseGetPlanOptions, BaseManagedClassElementMetadata, BasePlanParams, Binding, BindingActivation, BindingActivationRelation, BindingConstraints, BindingDeactivation, BindingDeactivationRelation, BindingScope, BindingType, CacheBindingInvalidation, ClassElementMetadata, ClassMetadata, ClassMetadataLifecycle, ConstantValueBinding, DeactivationParams, DynamicValueBinding, DynamicValueBuilder, Factory, FactoryBinding, GetAllOptions, GetMultipleServicePlanOptions, GetOptions, GetOptionsTagConstraint, GetPlanOptions, GetPlanOptionsTagConstraint, GetSingleServicePlanOptions, InjectFromBaseOptions, InjectFromHierarchyOptions, InjectFromOptions, InstanceBinding, InstanceBindingNode, LeafBindingNode, ManagedClassElementMetadata, MetadataName, MetadataTag, MultiInjectOptions, MultipleBindingPlanParamsConstraint, MultipleInjectionManagedClassElementMetadata, MultipleInjectionResolvedValueElementMetadata, NonCachedServiceNodeContext, OptionalGetAllOptions, OptionalGetOptions, PlanBindingNode, PlanParams, PlanParamsConstraint, PlanParamsOperations, PlanParamsTagConstraint, PlanResult, PlanServiceNode, PlanServiceNodeParent, PlanServiceRedirectionBindingNode, PlanTree, Provider, ProviderBinding, ResolutionContext, ResolutionParams, Resolved, ResolvedValueBinding, ResolvedValueBindingNode, ResolvedValueElementMetadata, ResolvedValueMetadata, ScopedBinding, ServiceRedirectionBinding, SingleBindingPlanParamsConstraint, SingleInjectionManagedClassElementMetadata, SingleInjectionResolvedValueElementMetadata, UnmanagedClassElementMetadata };
|
package/lib/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EACL,YAAY,EACZ,kBAAkB,EACnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OA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AClB,4CAA4C,EAC5C,6CAA6C,EAC7C,2BAA2B,EAC3B,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,UAAU,EACV,eAAe,EACf,qBAAqB,EACrB,iCAAiC,EACjC,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,QAAQ,EACR,oBAAoB,EACpB,wBAAwB,EACxB,4BAA4B,EAC5B,qBAAqB,EACrB,aAAa,EACb,yBAAyB,EACzB,0CAA0C,EAC1C,2CAA2C,EAC3C,6BAA6B,GAC9B,CAAC;AAEF,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,4BAA4B,EAC5B,wBAAwB,EACxB,oBAAoB,EACpB,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,MAAM,EACN,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,WAAW,EACX,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,sBAAsB,EACtB,aAAa,EACb,UAAU,EACV,OAAO,EACP,4BAA4B,EAC5B,gCAAgC,EAChC,0BAA0B,EAC1B,2BAA2B,EAC3B,MAAM,EACN,SAAS,EACT,mCAAmC,EACnC,iCAAiC,GAClC,CAAC"}
|
package/lib/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{getOwnReflectMetadata as e,setReflectMetadata as t,updateOwnReflectMetadata as n}from"@inversifyjs/reflect-metadata-utils";import{getBaseType as i}from"@inversifyjs/prototype-utils";import{stringifyServiceIdentifier as o,LazyServiceIdentifier as r,isPromise as s}from"@inversifyjs/common";const a="@inversifyjs/container/bindingId";function c(){const i=e(Object,a)??0;return i===Number.MAX_SAFE_INTEGER?t(Object,a,Number.MIN_SAFE_INTEGER):n(Object,a,()=>i,e=>e+1),i}const d={Request:"Request",Singleton:"Singleton",Transient:"Transient"},l={ConstantValue:"ConstantValue",DynamicValue:"DynamicValue",Factory:"Factory",Instance:"Instance",Provider:"Provider",ResolvedValue:"ResolvedValue",ServiceRedirection:"ServiceRedirection"};function*u(...e){for(const t of e)yield*t}class p{#e;#t;#n;constructor(e){this.#e=new Map,this.#t={};for(const t of Reflect.ownKeys(e))this.#t[t]=new Map;this.#n=e}add(e,t){this.#i(e).push(t);for(const n of Reflect.ownKeys(t))this.#o(n,t[n]).push(e)}clone(){const e=this.#r(),t=this.#s(),n=Reflect.ownKeys(this.#n),i=this._buildNewInstance(this.#n);this.#a(this.#e,i.#e,e,t);for(const t of n)this.#c(this.#t[t],i.#t[t],e);return i}get(e,t){return this.#t[e].get(t)}getAllKeys(e){return this.#t[e].keys()}removeByRelation(e,t){const n=this.get(e,t);if(void 0===n)return;const i=new Set(n);for(const n of i){const i=this.#e.get(n);if(void 0===i)throw new Error("Expecting model relation, none found");for(const o of i)o[e]===t&&this.#d(n,o);this.#e.delete(n)}}_buildNewInstance(e){return new p(e)}_cloneModel(e){return e}_cloneRelation(e){return e}#r(){const e=new Map;for(const t of this.#e.keys()){const n=this._cloneModel(t);e.set(t,n)}return e}#s(){const e=new Map;for(const t of this.#e.values())for(const n of t){const t=this._cloneRelation(n);e.set(n,t)}return e}#i(e){let t=this.#e.get(e);return void 0===t&&(t=[],this.#e.set(e,t)),t}#o(e,t){let n=this.#t[e].get(t);return void 0===n&&(n=[],this.#t[e].set(t,n)),n}#l(e,t){const n=t.get(e);if(void 0===n)throw new Error("Expecting model to be cloned, none found");return n}#u(e,t){const n=t.get(e);if(void 0===n)throw new Error("Expecting relation to be cloned, none found");return n}#c(e,t,n){for(const[i,o]of e){const e=new Array;for(const t of o)e.push(this.#l(t,n));t.set(i,e)}}#a(e,t,n,i){for(const[o,r]of e){const e=new Array;for(const t of r)e.push(this.#u(t,i));t.set(this.#l(o,n),e)}}#d(e,t){for(const n of Reflect.ownKeys(t))this.#p(e,n,t[n])}#p(e,t,n){const i=this.#t[t].get(n);if(void 0!==i){const o=i.indexOf(e);-1!==o&&i.splice(o,1),0===i.length&&this.#t[t].delete(n)}}}var f,v,g;!function(e){e.moduleId="moduleId",e.serviceId="serviceId"}(f||(f={}));class h{#f;#v;constructor(e,t){this.#f=t??new p({moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#v=e}static build(e){return new h(e)}add(e,t){this.#f.add(e,t)}clone(){return new h(this.#v,this.#f.clone())}get(e){const t=[],n=this.#f.get(f.serviceId,e);void 0!==n&&t.push(n);const i=this.#v()?.get(e);if(void 0!==i&&t.push(i),0!==t.length)return u(...t)}removeAllByModuleId(e){this.#f.removeByRelation(f.moduleId,e)}removeAllByServiceId(e){this.#f.removeByRelation(f.serviceId,e)}}function m(e){return e.isRight?{isRight:!0,value:e.value}:e}function y(e){switch(e.type){case l.ConstantValue:case l.DynamicValue:return function(e){return{cache:m(e.cache),id:e.id,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type,value:e.value}}(e);case l.Factory:return function(e){return{cache:m(e.cache),factory:e.factory,id:e.id,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type}}(e);case l.Instance:return function(e){return{cache:m(e.cache),id:e.id,implementationType:e.implementationType,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type}}(e);case l.Provider:return function(e){return{cache:m(e.cache),id:e.id,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,provider:e.provider,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type}}(e);case l.ResolvedValue:return function(e){return{cache:m(e.cache),factory:e.factory,id:e.id,isSatisfiedBy:e.isSatisfiedBy,metadata:e.metadata,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type}}(e);case l.ServiceRedirection:return function(e){return{id:e.id,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,serviceIdentifier:e.serviceIdentifier,targetServiceIdentifier:e.targetServiceIdentifier,type:e.type}}(e)}}!function(e){e.id="id",e.moduleId="moduleId",e.serviceId="serviceId"}(v||(v={}));class M extends p{_buildNewInstance(e){return new M(e)}_cloneModel(e){return y(e)}}class I{#g;#v;constructor(e,t){this.#g=t??new M({id:{isOptional:!1},moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#v=e}static build(e){return new I(e)}clone(){return new I(this.#v,this.#g.clone())}get(e){return this.getNonParentBindings(e)??this.#v()?.get(e)}*getChained(e){const t=this.getNonParentBindings(e);void 0!==t&&(yield*t);const n=this.#v();void 0!==n&&(yield*n.getChained(e))}getBoundServices(){const e=new Set(this.#g.getAllKeys(v.serviceId)),t=this.#v();if(void 0!==t)for(const n of t.getBoundServices())e.add(n);return e}getById(e){return this.#g.get(v.id,e)??this.#v()?.getById(e)}getByModuleId(e){return this.#g.get(v.moduleId,e)??this.#v()?.getByModuleId(e)}getNonParentBindings(e){return this.#g.get(v.serviceId,e)}getNonParentBoundServices(){return this.#g.getAllKeys(v.serviceId)}removeById(e){this.#g.removeByRelation(v.id,e)}removeAllByModuleId(e){this.#g.removeByRelation(v.moduleId,e)}removeAllByServiceId(e){this.#g.removeByRelation(v.serviceId,e)}set(e){const t={[v.id]:e.id,[v.serviceId]:e.serviceIdentifier};void 0!==e.moduleId&&(t[v.moduleId]=e.moduleId),this.#g.add(e,t)}}!function(e){e.moduleId="moduleId",e.serviceId="serviceId"}(g||(g={}));class b{#h;#v;constructor(e,t){this.#h=t??new p({moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#v=e}static build(e){return new b(e)}add(e,t){this.#h.add(e,t)}clone(){return new b(this.#v,this.#h.clone())}get(e){const t=[],n=this.#h.get(g.serviceId,e);void 0!==n&&t.push(n);const i=this.#v()?.get(e);if(void 0!==i&&t.push(i),0!==t.length)return u(...t)}removeAllByModuleId(e){this.#h.removeByRelation(g.moduleId,e)}removeAllByServiceId(e){this.#h.removeByRelation(g.serviceId,e)}}function w(e,t,n){const i=Array.isArray(e)?e:[e];if(void 0!==n)if("number"!=typeof n)Reflect.decorate(i,t.prototype,n);else for(const e of i)e(t,void 0,n);else Reflect.decorate(i,t)}const C="@inversifyjs/core/classMetadataReflectKey";function S(){return{constructorArguments:[],lifecycle:{postConstructMethodName:void 0,preDestroyMethodName:void 0},properties:new Map,scope:void 0}}const N="@inversifyjs/core/pendingClassMetadataCountReflectKey";const P=Symbol.for("@inversifyjs/core/InversifyCoreError");class R extends Error{[P];kind;constructor(e,t,n){super(t,n),this[P]=!0,this.kind=e}static is(e){return"object"==typeof e&&null!==e&&!0===e[P]}static isErrorOfKind(e,t){return R.is(e)&&e.kind===t}}var T,A,x;function j(t){const n=e(t,C)??S();if(!function(t){const n=e(t,N);return void 0!==n&&0!==n}(t))return function(e,t){const n=[];if(t.length<e.length)throw new R(T.missingInjectionDecorator,`Found unexpected missing metadata on type "${e.name}". "${e.name}" constructor requires at least ${e.length.toString()} arguments, found ${t.length.toString()} instead.\nAre you using @inject, @multiInject or @unmanaged decorators in every non optional constructor argument?\n\nIf you're using typescript and want to rely on auto injection, set "emitDecoratorMetadata" compiler option to true`);for(let e=0;e<t.length;++e)void 0===t[e]&&n.push(e);if(n.length>0)throw new R(T.missingInjectionDecorator,`Found unexpected missing metadata on type "${e.name}" at constructor indexes "${n.join('", "')}".\n\nAre you using @inject, @multiInject or @unmanaged decorators at those indexes?\n\nIf you're using typescript and want to rely on auto injection, set "emitDecoratorMetadata" compiler option to true`)}(t,n.constructorArguments),n;!function(e,t){const n=[];for(let i=0;i<t.constructorArguments.length;++i){const o=t.constructorArguments[i];void 0!==o&&o.kind!==A.unknown||n.push(` - Missing or incomplete metadata for type "${e.name}" at constructor argument with index ${i.toString()}.\nEvery constructor parameter must be decorated either with @inject, @multiInject or @unmanaged decorator.`)}for(const[i,o]of t.properties)o.kind===A.unknown&&n.push(` - Missing or incomplete metadata for type "${e.name}" at property "${i.toString()}".\nThis property must be decorated either with @inject or @multiInject decorator.`);if(0===n.length)throw new R(T.unknown,`Unexpected class metadata for type "${e.name}" with uncompletion traces.\nThis might be caused by one of the following reasons:\n\n1. A third party library is targeting inversify reflection metadata.\n2. A bug is causing the issue. Consider submiting an issue to fix it.`);throw new R(T.missingInjectionDecorator,`Invalid class metadata at type ${e.name}:\n\n${n.join("\n\n")}`)}(t,n)}function B(){return 0}function F(e){return t=>{void 0!==t&&t.kind===A.unknown&&n(e,N,B,e=>e-1)}}function k(e,t){return(...n)=>i=>{if(void 0===i)return e(...n);if(i.kind===x.unmanaged)throw new R(T.injectionDecoratorConflict,"Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found");return t(i,...n)}}function $(e){if(e.kind!==A.unknown&&!0!==e.isFromTypescriptParamType)throw new R(T.injectionDecoratorConflict,"Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found")}!function(e){e[e.injectionDecoratorConflict=0]="injectionDecoratorConflict",e[e.missingInjectionDecorator=1]="missingInjectionDecorator",e[e.planning=2]="planning",e[e.resolution=3]="resolution",e[e.unknown=4]="unknown"}(T||(T={})),function(e){e[e.unknown=32]="unknown"}(A||(A={})),function(e){e[e.multipleInjection=0]="multipleInjection",e[e.singleInjection=1]="singleInjection",e[e.unmanaged=2]="unmanaged"}(x||(x={}));const D=k(function(e,t,n){return e===x.multipleInjection?{chained:n?.chained??!1,kind:e,name:void 0,optional:!1,tags:new Map,value:t}:{kind:e,name:void 0,optional:!1,tags:new Map,value:t}},function(e,t,n,i){return $(e),t===x.multipleInjection?{...e,chained:i?.chained??!1,kind:t,value:n}:{...e,kind:t,value:n}});function V(e,t){return n=>{const i=n.properties.get(t);return n.properties.set(t,e(i)),n}}var E;function O(e,t,n,i){if(R.isErrorOfKind(i,T.injectionDecoratorConflict)){const o=function(e,t,n){if(void 0===n){if(void 0===t)throw new R(T.unknown,"Unexpected undefined property and index values");return{kind:E.property,property:t,targetClass:e.constructor}}return"number"==typeof n?{index:n,kind:E.parameter,targetClass:e}:{kind:E.method,method:t,targetClass:e}}(e,t,n);throw new R(T.injectionDecoratorConflict,`Unexpected injection error.\n\nCause:\n\n${i.message}\n\nDetails\n\n${function(e){switch(e.kind){case E.method:return`[class: "${e.targetClass.name}", method: "${e.method.toString()}"]`;case E.parameter:return`[class: "${e.targetClass.name}", index: "${e.index.toString()}"]`;case E.property:return`[class: "${e.targetClass.name}", property: "${e.property.toString()}"]`}}(o)}`,{cause:i})}throw i}function _(e,t){return(i,o,r)=>{try{void 0===r?function(e,t){const i=L(e,t);return(e,t)=>{n(e.constructor,C,S,V(i(e),t))}}(e,t)(i,o):"number"==typeof r?function(e,t){const i=L(e,t);return(e,t,o)=>{if(!function(e,t){return"function"==typeof e&&void 0===t}(e,t))throw new R(T.injectionDecoratorConflict,`Found an @inject decorator in a non constructor parameter.\nFound @inject decorator at method "${t?.toString()??""}" at class "${e.constructor.name}"`);n(e,C,S,function(e,t){return n=>{const i=n.constructorArguments[t];return n.constructorArguments[t]=e(i),n}}(i(e),o))}}(e,t)(i,o,r):function(e,t){const i=L(e,t);return(e,t,o)=>{if(!function(e){return void 0!==e.set}(o))throw new R(T.injectionDecoratorConflict,`Found an @inject decorator in a non setter property method.\nFound @inject decorator at method "${t.toString()}" at class "${e.constructor.name}"`);n(e.constructor,C,S,V(i(e),t))}}(e,t)(i,o,r)}catch(e){O(i,o,r,e)}}}function L(e,t){return n=>{const i=t(n);return t=>(i(t),e(t))}}function z(e){return _(D(x.singleInjection,e),F)}!function(e){e[e.method=0]="method",e[e.parameter=1]="parameter",e[e.property=2]="property"}(E||(E={}));const U="@inversifyjs/core/classIsInjectableFlagReflectKey";const K=[Array,BigInt,Boolean,Function,Number,Object,String];function q(t){const i=e(t,"design:paramtypes");void 0!==i&&n(t,C,S,function(e){return t=>(e.forEach((e,n)=>{var i;void 0!==t.constructorArguments[n]||(i=e,K.includes(i))||(t.constructorArguments[n]=function(e){return{isFromTypescriptParamType:!0,kind:x.singleInjection,name:void 0,optional:!1,tags:new Map,value:e}}(e))}),t)}(i))}function G(i){return o=>{!function(n){if(void 0!==e(n,U))throw new R(T.injectionDecoratorConflict,`Cannot apply @injectable decorator multiple times at class "${n.name}"`);t(n,U,!0)}(o),q(o),void 0!==i&&n(o,C,S,e=>({...e,scope:i}))}}function W(e,t,n){let i;return e.extendConstructorArguments??!0?(i=[...t.constructorArguments],n.constructorArguments.map((e,t)=>{i[t]=e})):i=n.constructorArguments,i}function X(e,t,n){let i;return i=e.extendProperties??!0?new Map(u(t.properties,n.properties)):n.properties,i}function H(e){return t=>{const i=j(e.type);n(t,C,S,function(e,t){const n=n=>({constructorArguments:W(e,t,n),lifecycle:n.lifecycle,properties:X(e,t,n),scope:n.scope});return n}(e,i))}}function J(e){return t=>{const n=i(t);if(void 0===n)throw new R(T.injectionDecoratorConflict,`Expected base type for type "${t.name}", none found.`);H({...e,type:n})(t)}}function Q(e,t){return _(D(x.multipleInjection,e,t),F)}function Y(e){return t=>{void 0===t&&n(e,N,B,e=>e+1)}}function Z(e){return t=>{const n=t??{kind:A.unknown,name:void 0,optional:!1,tags:new Map};if(n.kind===x.unmanaged)throw new R(T.injectionDecoratorConflict,"Unexpected injection found. Found @unmanaged injection with additional @named, @optional, @tagged or @targetName injections");return e(n)}}function ee(e){const t=Z(function(e){return t=>{if(void 0!==t.name)throw new R(T.injectionDecoratorConflict,"Unexpected duplicated named decorator");return t.name=e,t}}(e));return _(t,Y)}function te(e){if(e.optional)throw new R(T.injectionDecoratorConflict,"Unexpected duplicated optional decorator");return e.optional=!0,e}function ne(){return _(Z(te),Y)}function ie(){return(e,t,i)=>{try{n(e.constructor,C,S,(o=t,e=>{if(void 0!==e.lifecycle.postConstructMethodName)throw new R(T.injectionDecoratorConflict,"Unexpected duplicated postConstruct decorator");return e.lifecycle.postConstructMethodName=o,e}))}catch(n){O(e,t,void 0,n)}var o}}function oe(){return(e,t,i)=>{try{n(e.constructor,C,S,(o=t,e=>{if(void 0!==e.lifecycle.preDestroyMethodName)throw new R(T.injectionDecoratorConflict,"Unexpected duplicated preDestroy decorator");return e.lifecycle.preDestroyMethodName=o,e}))}catch(n){O(e,t,void 0,n)}var o}}function re(e,t){const n=Z(function(e,t){return n=>{if(n.tags.has(e))throw new R(T.injectionDecoratorConflict,"Unexpected duplicated tag decorator with existing tag");return n.tags.set(e,t),n}}(e,t));return _(n,Y)}function se(){return{kind:x.unmanaged}}const ae=k(se,function(e){if($(e),function(e){return void 0!==e.name||e.optional||e.tags.size>0}(e))throw new R(T.injectionDecoratorConflict,"Unexpected injection found. Found @unmanaged injection with additional @named, @optional, @tagged or @targetName injections");return se()});function ce(){return _(ae(),F)}var de;function le(e,t){if(function(e){return e instanceof Error&&(e instanceof RangeError&&/stack space|call stack|too much recursion/i.test(e.message)||"InternalError"===e.name&&/too much recursion/.test(e.message))}(t)){const n=function(e){const t=[...e];if(0===t.length)return"(No dependency trace)";return t.map(o).join(" -> ")}(function(e){const t=new Set;for(const n of e.servicesBranch){if(t.has(n))return[...t,n];t.add(n)}return[...t]}(e));throw new R(T.planning,`Circular dependency found: ${n}`,{cause:t})}throw t}!function(e){e[e.multipleInjection=0]="multipleInjection",e[e.singleInjection=1]="singleInjection"}(de||(de={}));const ue=Symbol.for("@inversifyjs/core/LazyPlanServiceNode");class pe{[ue];_serviceIdentifier;_serviceNode;constructor(e,t){this[ue]=!0,this._serviceNode=e,this._serviceIdentifier=t}get bindings(){return this._getNode().bindings}get isContextFree(){return this._getNode().isContextFree}get serviceIdentifier(){return this._serviceIdentifier}set bindings(e){this._getNode().bindings=e}set isContextFree(e){this._getNode().isContextFree=e}static is(e){return"object"==typeof e&&null!==e&&!0===e[ue]}invalidate(){this._serviceNode=void 0}isExpanded(){return void 0!==this._serviceNode}_getNode(){return void 0===this._serviceNode&&(this._serviceNode=this._buildPlanServiceNode()),this._serviceNode}}class fe{#m;constructor(e){this.#m=e}get name(){return this.#m.elem.name}get serviceIdentifier(){return this.#m.elem.serviceIdentifier}get tags(){return this.#m.elem.tags}getAncestor(){if(this.#m.elem.getAncestorsCalled=!0,void 0!==this.#m.previous)return new fe(this.#m.previous)}}function ve(e,t,n){const i=n?.customServiceIdentifier??t.serviceIdentifier,o=(!0===n?.chained?[...e.operations.getBindingsChained(i)]:[...e.operations.getBindings(i)??[]]).filter(e=>e.isSatisfiedBy(t));if(0===o.length&&void 0!==e.autobindOptions&&"function"==typeof i){const t=function(e,t){const n=j(t),i=n.scope??e.scope;return{cache:{isRight:!1,value:void 0},id:c(),implementationType:t,isSatisfiedBy:()=>!0,moduleId:void 0,onActivation:void 0,onDeactivation:void 0,scope:i,serviceIdentifier:t,type:l.Instance}}(e.autobindOptions,i);e.operations.setBinding(t),o.push(t)}return o}class ge{last;constructor(e){this.last=e}concat(e){return new ge({elem:e,previous:this.last})}[Symbol.iterator](){let e=this.last;return{next:()=>{if(void 0===e)return{done:!0,value:void 0};const t=e.elem;return e=e.previous,{done:!1,value:t}}}}}function he(e){const t=new Map;return void 0!==e.rootConstraints.tag&&t.set(e.rootConstraints.tag.key,e.rootConstraints.tag.value),new ge({elem:{getAncestorsCalled:!1,name:e.rootConstraints.name,serviceIdentifier:e.rootConstraints.serviceIdentifier,tags:t},previous:void 0})}function me(e){return void 0!==e.redirections}function ye(e,t,n,i){const r=n.elem.serviceIdentifier,s=n.previous?.elem.serviceIdentifier;Array.isArray(e)?function(e,t,n,i,r,s){if(0!==e.length){const t=s[s.length-1]??n,a=`Ambiguous bindings found for service: "${o(t)}".${we(s)}\n\nRegistered bindings:\n\n${e.map(e=>function(e){switch(e.type){case l.Instance:return`[ type: "${e.type}", serviceIdentifier: "${o(e.serviceIdentifier)}", scope: "${e.scope}", implementationType: "${e.implementationType.name}" ]`;case l.ServiceRedirection:return`[ type: "${e.type}", serviceIdentifier: "${o(e.serviceIdentifier)}", redirection: "${o(e.targetServiceIdentifier)}" ]`;default:return`[ type: "${e.type}", serviceIdentifier: "${o(e.serviceIdentifier)}", scope: "${e.scope}" ]`}}(e.binding)).join("\n")}\n\nTrying to resolve bindings for "${Ie(n,i)}".${be(r)}`;throw new R(T.planning,a)}t||Me(n,i,r,s)}(e,t,r,s,n.elem,i):function(e,t,n,i,o,r){void 0!==e||t||Me(n,i,o,r)}(e,t,r,s,n.elem,i)}function Me(e,t,n,i){const r=i[i.length-1]??e,s=`No bindings found for service: "${o(r)}".\n\nTrying to resolve bindings for "${Ie(e,t)}".${we(i)}${be(n)}`;throw new R(T.planning,s)}function Ie(e,t){return void 0===t?`${o(e)} (Root service)`:o(t)}function be(e){const t=0===e.tags.size?"":`\n- tags:\n - ${[...e.tags.keys()].map(e=>e.toString()).join("\n - ")}`;return`\n\nBinding constraints:\n- service identifier: ${o(e.serviceIdentifier)}\n- name: ${e.name?.toString()??"-"}${t}`}function we(e){return 0===e.length?"":`\n\n- service redirections:\n - ${e.map(e=>o(e)).join("\n - ")}`}function Ce(e,t,n,i){if(1===e.redirections.length){const[o]=e.redirections;return void(me(o)&&Ce(o,t,n,[...i,o.binding.targetServiceIdentifier]))}ye(e.redirections,t,n,i)}function Se(e,t,n){if(Array.isArray(e.bindings)&&1===e.bindings.length){const[i]=e.bindings;return void(me(i)&&Ce(i,t,n,[i.binding.targetServiceIdentifier]))}ye(e.bindings,t,n,[])}function Ne(e){return r.is(e)?e.unwrap():e}function Pe(e){return(t,n,i)=>{const o=Ne(i.value),r=n.concat({getAncestorsCalled:!1,name:i.name,serviceIdentifier:o,tags:i.tags}),s=new fe(r.last),a=i.kind===x.multipleInjection&&i.chained,c=ve(t,s,{chained:a}),d=[],l={bindings:d,isContextFree:!0,serviceIdentifier:o};if(d.push(...e(t,r,c,l,a)),l.isContextFree=!r.last.elem.getAncestorsCalled,i.kind===x.singleInjection){Se(l,i.optional,r.last);const[e]=d;l.bindings=e}return l}}function Re(e){return(t,n,i)=>{const o=Ne(i.value),r=n.concat({getAncestorsCalled:!1,name:i.name,serviceIdentifier:o,tags:i.tags}),s=new fe(r.last),a=i.kind===de.multipleInjection&&i.chained,c=ve(t,s,{chained:a}),d=[],l={bindings:d,isContextFree:!0,serviceIdentifier:o};if(d.push(...e(t,r,c,l,a)),l.isContextFree=!r.last.elem.getAncestorsCalled,i.kind===de.singleInjection){Se(l,i.optional,r.last);const[e]=d;l.bindings=e}return l}}function Te(e){const t=function(e){return(t,n,i)=>{const o={binding:n,classMetadata:t.operations.getClassMetadata(n.implementationType),constructorParams:[],propertyParams:new Map},r={autobindOptions:t.autobindOptions,node:o,operations:t.operations,servicesBranch:t.servicesBranch};return e(r,i)}}(e),n=function(e){return(t,n,i)=>{const o={binding:n,params:[]},r={autobindOptions:t.autobindOptions,node:o,operations:t.operations,servicesBranch:t.servicesBranch};return e(r,i)}}(e),i=(e,i,r,s,a)=>{const c=me(s)?s.binding.targetServiceIdentifier:s.serviceIdentifier;e.servicesBranch.push(c);const d=[];for(const s of r)switch(s.type){case l.Instance:d.push(t(e,s,i));break;case l.ResolvedValue:d.push(n(e,s,i));break;case l.ServiceRedirection:{const t=o(e,i,s,a);d.push(t);break}default:d.push({binding:s})}return e.servicesBranch.pop(),d},o=function(e){return(t,n,i,o)=>{const r={binding:i,redirections:[]},s=ve(t,new fe(n.last),{chained:o,customServiceIdentifier:i.targetServiceIdentifier});return r.redirections.push(...e(t,n,s,r,o)),r}}(i);return i}function Ae(e,t,n,i){if(void 0!==e&&(pe.is(n)&&!n.isExpanded()||n.isContextFree)){const i={tree:{root:n}};t.setPlan(e,i)}else t.setNonCachedServiceNode(n,i)}class xe extends pe{#y;#M;#I;#b;constructor(e,t,n,i,o){super(o,Ne(i.value)),this.#M=t,this.#y=e,this.#I=n,this.#b=i}_buildPlanServiceNode(){return this.#M(this.#y,this.#I,this.#b)}}class je extends pe{#y;#w;#I;#C;constructor(e,t,n,i,o){super(o,Ne(i.value)),this.#y=e,this.#w=t,this.#I=n,this.#C=i}_buildPlanServiceNode(){return this.#w(this.#y,this.#I,this.#C)}}function Be(e,t,n,i){const o=function(e,t){const n=function(e,t){return(n,i,o)=>{if(o.kind===x.unmanaged)return;const s=function(e){let t;if(0===e.tags.size)t=void 0;else{if(1!==e.tags.size)return;{const[n,i]=e.tags.entries().next().value;t={key:n,value:i}}}const n=r.is(e.value)?e.value.unwrap():e.value;return e.kind===x.multipleInjection?{chained:e.chained,isMultiple:!0,name:e.name,optional:e.optional,serviceIdentifier:n,tag:t}:{isMultiple:!1,name:e.name,optional:e.optional,serviceIdentifier:n,tag:t}}(o);if(void 0!==s){const e=n.operations.getPlan(s);if(void 0!==e&&e.tree.root.isContextFree)return e.tree.root}const a=t(n,i,o),c=new xe(n,e,i,o,a);return Ae(s,n.operations,c,{bindingConstraintsList:i,chainedBindings:o.kind===x.multipleInjection&&o.chained,optionalBindings:o.optional}),c}}(e,t);return(e,t,i)=>{const o=t.classMetadata;for(const[r,s]of o.constructorArguments.entries())t.constructorParams[r]=n(e,i,s);for(const[r,s]of o.properties){const o=n(e,i,s);void 0!==o&&t.propertyParams.set(r,o)}return e.node}}(e,n),s=function(e,t){const n=function(e,t){return(n,i,o)=>{const s=function(e){let t;if(0===e.tags.size)t=void 0;else{if(1!==e.tags.size)return;{const[n,i]=e.tags.entries().next().value;t={key:n,value:i}}}const n=r.is(e.value)?e.value.unwrap():e.value;return e.kind===de.multipleInjection?{chained:e.chained,isMultiple:!0,name:e.name,optional:e.optional,serviceIdentifier:n,tag:t}:{isMultiple:!1,name:e.name,optional:e.optional,serviceIdentifier:n,tag:t}}(o);if(void 0!==s){const e=n.operations.getPlan(s);if(void 0!==e&&e.tree.root.isContextFree)return e.tree.root}const a=t(n,i,o),c=new je(n,e,i,o,a);return Ae(s,n.operations,c,{bindingConstraintsList:i,chainedBindings:o.kind===de.multipleInjection&&o.chained,optionalBindings:o.optional}),c}}(e,t);return(e,t,i)=>{const o=t.binding.metadata;for(const[r,s]of o.arguments.entries())t.params[r]=n(e,i,s);return e.node}}(t,i);return(e,t)=>e.node.binding.type===l.Instance?o(e,e.node,t):s(e,e.node,t)}class Fe extends pe{#y;constructor(e,t){super(t,t.serviceIdentifier),this.#y=e}_buildPlanServiceNode(){return Ee(this.#y)}}const ke=Pe(Ve),$e=Re(Ve),De=Te(Be(ke,$e,ke,$e));function Ve(e,t,n,i,o){return De(e,t,n,i,o)}const Ee=function(e){return t=>{const n=he(t),i=new fe(n.last),o=t.rootConstraints.isMultiple&&t.rootConstraints.chained,r=ve(t,i,{chained:o}),s=[],a={bindings:s,isContextFree:!0,serviceIdentifier:t.rootConstraints.serviceIdentifier};if(s.push(...e(t,n,r,a,o)),a.isContextFree=!n.last.elem.getAncestorsCalled,!t.rootConstraints.isMultiple){Se(a,t.rootConstraints.isOptional??!1,n.last);const[e]=s;a.bindings=e}return a}}(De);function Oe(e){try{const t=function(e){return e.rootConstraints.isMultiple?{chained:e.rootConstraints.chained,isMultiple:!0,name:e.rootConstraints.name,optional:e.rootConstraints.isOptional??!1,serviceIdentifier:e.rootConstraints.serviceIdentifier,tag:e.rootConstraints.tag}:{isMultiple:!1,name:e.rootConstraints.name,optional:e.rootConstraints.isOptional??!1,serviceIdentifier:e.rootConstraints.serviceIdentifier,tag:e.rootConstraints.tag}}(e),n=e.operations.getPlan(t);if(void 0!==n)return n;const i=Ee(e),o={tree:{root:new Fe(e,i)}};return e.operations.setPlan(t,o),o}catch(t){le(e,t)}}var _e;!function(e){e.bindingAdded="bindingAdded",e.bindingRemoved="bindingRemoved"}(_e||(_e={}));class Le{#S;#N;#P;constructor(){this.#S=[],this.#N=8,this.#P=1024}*[Symbol.iterator](){let e=0;for(const t of this.#S){const n=t.deref();void 0===n?++e:yield n}this.#S.length>=this.#N&&this.#R(e)&&this.#T(e)}push(e){const t=new WeakRef(e);if(this.#S.push(t),this.#S.length>=this.#N&&this.#S.length%this.#P===0){let e=0;for(const t of this.#S)void 0===t.deref()&&++e;this.#R(e)&&this.#T(e)}}#T(e){const t=new Array(this.#S.length-e);let n=0;for(const e of this.#S)e.deref()&&(t[n++]=e);this.#S=t}#R(e){return e>=.5*this.#S.length}}const ze=Te(Be(ke,$e,function(e,t,n){return Ue(e,t,n)},function(e,t,n){return Ke(e,t,n)})),Ue=function(e){const t=Pe(e);return(e,n,i)=>{try{return t(e,n,i)}catch(e){if(R.isErrorOfKind(e,T.planning))return;throw e}}}(ze),Ke=function(e){const t=Re(e);return(e,n,i)=>{try{return t(e,n,i)}catch(e){if(R.isErrorOfKind(e,T.planning))return;throw e}}}(ze);function qe(e,t,n,i,o){if(pe.is(t)&&!t.isExpanded())return{isContextFreeBinding:!0,shouldInvalidateServiceNode:!1};const r=new fe(i.last);if(!n.isSatisfiedBy(r)||i.last.elem.getAncestorsCalled)return{isContextFreeBinding:!i.last.elem.getAncestorsCalled,shouldInvalidateServiceNode:!1};const[s]=ze(e,i,[n],t,o);if(Array.isArray(t.bindings))t.bindings.push(s);else{if(void 0!==t.bindings){if(!pe.is(t))throw new R(T.planning,"Unexpected non-lazy plan service node. This is likely a bug in the planning logic. Please, report this issue");return{isContextFreeBinding:!0,shouldInvalidateServiceNode:!0}}t.bindings=s}return{isContextFreeBinding:!0,shouldInvalidateServiceNode:!1}}function Ge(e,t,n,i){if(pe.is(e)&&!e.isExpanded())return{bindingNodeRemoved:void 0,isContextFreeBinding:!0};const o=new fe(n.last);if(!t.isSatisfiedBy(o)||n.last.elem.getAncestorsCalled)return{bindingNodeRemoved:void 0,isContextFreeBinding:!n.last.elem.getAncestorsCalled};let r;if(Array.isArray(e.bindings))e.bindings=e.bindings.filter(e=>e.binding!==t||(r=e,!1));else if(e.bindings?.binding===t)if(r=e.bindings,i)e.bindings=void 0;else{if(!pe.is(e))throw new R(T.planning,"Unexpected non-lazy plan service node. This is likely a bug in the planning logic. Please, report this issue");e.invalidate()}return{bindingNodeRemoved:r,isContextFreeBinding:!0}}class We{#A;#x;#j;#B;#F;#k;constructor(){this.#A=new Map,this.#x=this.#$(),this.#j=this.#$(),this.#B=this.#$(),this.#F=this.#$(),this.#k=new Le}clearCache(){for(const e of this.#D())e.clear();for(const e of this.#k)e.clearCache()}get(e){return void 0===e.name?void 0===e.tag?this.#V(this.#x,e).get(e.serviceIdentifier):this.#V(this.#F,e).get(e.serviceIdentifier)?.get(e.tag.key)?.get(e.tag.value):void 0===e.tag?this.#V(this.#j,e).get(e.serviceIdentifier)?.get(e.name):this.#V(this.#B,e).get(e.serviceIdentifier)?.get(e.name)?.get(e.tag.key)?.get(e.tag.value)}invalidateServiceBinding(e){this.#E(e),this.#O(e),this.#_(e),this.#L(e),this.#z(e);for(const t of this.#k)t.invalidateServiceBinding(e)}set(e,t){void 0===e.name?void 0===e.tag?this.#V(this.#x,e).set(e.serviceIdentifier,t):this.#U(this.#U(this.#V(this.#F,e),e.serviceIdentifier),e.tag.key).set(e.tag.value,t):void 0===e.tag?this.#U(this.#V(this.#j,e),e.serviceIdentifier).set(e.name,t):this.#U(this.#U(this.#U(this.#V(this.#B,e),e.serviceIdentifier),e.name),e.tag.key).set(e.tag.value,t)}setNonCachedServiceNode(e,t){let n=this.#A.get(e.serviceIdentifier);void 0===n&&(n=new Map,this.#A.set(e.serviceIdentifier,n)),n.set(e,t)}subscribe(e){this.#k.push(e)}#$(){const e=new Array(8);for(let t=0;t<e.length;++t)e[t]=new Map;return e}#K(e,t,n,i){const o=!!(2&t);let r;if(o){r={chained:!!(0&t),isMultiple:o,serviceIdentifier:e.binding.serviceIdentifier}}else r={isMultiple:o,serviceIdentifier:e.binding.serviceIdentifier};return!!(1&t)&&(r.isOptional=!0),void 0!==n&&(r.name=n),void 0!==i&&(r.tag=i),{autobindOptions:void 0,operations:e.operations,rootConstraints:r,servicesBranch:[]}}#U(e,t){let n=e.get(t);return void 0===n&&(n=new Map,e.set(t,n)),n}#V(e,t){return e[this.#q(t)]}#D(){return[this.#A,...this.#x,...this.#j,...this.#B,...this.#F]}#q(e){return e.isMultiple?(e.chained?4:0)|(e.optional?1:0)|2:e.optional?1:0}#O(e){for(const[t,n]of this.#j.entries()){const i=n.get(e.binding.serviceIdentifier);if(void 0!==i)for(const[n,o]of i.entries())this.#G(e,o,t,n,void 0)}}#_(e){for(const[t,n]of this.#B.entries()){const i=n.get(e.binding.serviceIdentifier);if(void 0!==i)for(const[n,o]of i.entries())for(const[i,r]of o.entries())for(const[o,s]of r.entries())this.#G(e,s,t,n,{key:i,value:o})}}#W(e){switch(e.binding.type){case l.ServiceRedirection:for(const t of e.redirections)this.#W(t);break;case l.Instance:for(const t of e.constructorParams)void 0!==t&&this.#X(t);for(const t of e.propertyParams.values())this.#X(t);break;case l.ResolvedValue:for(const t of e.params)this.#X(t)}}#X(e){const t=this.#A.get(e.serviceIdentifier);void 0!==t&&t.has(e)&&(t.delete(e),this.#H(e))}#H(e){if((!pe.is(e)||e.isExpanded())&&void 0!==e.bindings)if(Array.isArray(e.bindings))for(const t of e.bindings)this.#W(t);else this.#W(e.bindings)}#z(e){const t=this.#A.get(e.binding.serviceIdentifier);if(void 0!==t)switch(e.kind){case _e.bindingAdded:for(const[n,i]of t){const t=qe({autobindOptions:void 0,operations:e.operations,servicesBranch:[]},n,e.binding,i.bindingConstraintsList,i.chainedBindings);t.isContextFreeBinding?t.shouldInvalidateServiceNode&&pe.is(n)&&(this.#H(n),n.invalidate()):this.clearCache()}break;case _e.bindingRemoved:for(const[n,i]of t){const t=Ge(n,e.binding,i.bindingConstraintsList,i.optionalBindings);t.isContextFreeBinding?void 0!==t.bindingNodeRemoved&&this.#W(t.bindingNodeRemoved):this.clearCache()}}}#E(e){for(const[t,n]of this.#x.entries()){const i=n.get(e.binding.serviceIdentifier);this.#G(e,i,t,void 0,void 0)}}#L(e){for(const[t,n]of this.#F.entries()){const i=n.get(e.binding.serviceIdentifier);if(void 0!==i)for(const[n,o]of i.entries())for(const[i,r]of o.entries())this.#G(e,r,t,void 0,{key:n,value:i})}}#G(e,t,n,i,o){if(void 0!==t&&pe.is(t.tree.root)){const c=this.#K(e,n,i,o);switch(e.kind){case _e.bindingAdded:{const n=(r=c,s=t.tree.root,a=e.binding,pe.is(s)&&!s.isExpanded()?{isContextFreeBinding:!0,shouldInvalidateServiceNode:!1}:qe(r,s,a,he(r),r.rootConstraints.isMultiple&&r.rootConstraints.chained));n.isContextFreeBinding?n.shouldInvalidateServiceNode&&(this.#H(t.tree.root),t.tree.root.invalidate()):this.clearCache()}break;case _e.bindingRemoved:{const n=function(e,t,n){return pe.is(t)&&!t.isExpanded()?{bindingNodeRemoved:void 0,isContextFreeBinding:!0}:Ge(t,n,he(e),e.rootConstraints.isOptional??!1)}(c,t.tree.root,e.binding);n.isContextFreeBinding?void 0!==n.bindingNodeRemoved&&this.#W(n.bindingNodeRemoved):this.clearCache()}}}var r,s,a}}function Xe(e,t){return s(t)?(e.cache={isRight:!0,value:t},t.then(t=>He(e,t))):He(e,t)}function He(e,t){return e.cache={isRight:!0,value:t},t}function Je(e,t,n){const i=e.getActivations(t);return void 0===i?n:s(n)?Qe(e,n,i[Symbol.iterator]()):function(e,t,n){let i=t,o=n.next();for(;!0!==o.done;){const t=o.value(e.context,i);if(s(t))return Qe(e,t,n);i=t,o=n.next()}return i}(e,n,i[Symbol.iterator]())}async function Qe(e,t,n){let i=await t,o=n.next();for(;!0!==o.done;)i=await o.value(e.context,i),o=n.next();return i}function Ye(e,t,n){let i=n;if(void 0!==t.onActivation){const n=t.onActivation;i=s(i)?i.then(t=>n(e.context,t)):n(e.context,i)}return Je(e,t.serviceIdentifier,i)}function Ze(e){return(t,n)=>{if(n.cache.isRight)return n.cache.value;return Xe(n,Ye(t,n,e(t,n)))}}const et=Ze(function(e,t){return t.value});function tt(e){return e}function nt(e,t){return(n,i)=>{const o=e(i);switch(o.scope){case d.Singleton:if(o.cache.isRight)return o.cache.value;return Xe(o,Ye(n,o,t(n,i)));case d.Request:{if(n.requestScopeCache.has(o.id))return n.requestScopeCache.get(o.id);const e=Ye(n,o,t(n,i));return n.requestScopeCache.set(o.id,e),e}case d.Transient:return Ye(n,o,t(n,i))}}}const it=(e=>nt(tt,e))(function(e,t){return t.value(e.context)});const ot=Ze(function(e,t){return t.factory(e.context)});function rt(e,t,n){const i=function(e,t,n){if(void 0===n)return;if(!(n in e))throw new R(T.resolution,`Expecting a "${n.toString()}" property when resolving "${t.implementationType.name}" class @postConstruct decorated method, none found.`);if("function"!=typeof e[n])throw new R(T.resolution,`Expecting a "${n.toString()}" method when resolving "${t.implementationType.name}" class @postConstruct decorated method, a non function property was found instead.`);{let i;try{i=e[n]()}catch(e){throw new R(T.resolution,`Unexpected error found when calling "${n.toString()}" @postConstruct decorated method on class "${t.implementationType.name}"`,{cause:e})}if(s(i))return async function(e,t,n){try{await n}catch(n){throw new R(T.resolution,`Unexpected error found when calling "${t.toString()}" @postConstruct decorated method on class "${e.implementationType.name}"`,{cause:n})}}(t,n,i)}}(e,t,n);return s(i)?i.then(()=>e):e}function st(e){return(t,n,i)=>{const o=new i.binding.implementationType(...t),r=e(n,o,i);return s(r)?r.then(()=>rt(o,i.binding,i.classMetadata.lifecycle.postConstructMethodName)):rt(o,i.binding,i.classMetadata.lifecycle.postConstructMethodName)}}const at=Ze(function(e,t){return t.provider(e.context)});function ct(e){return e.binding}function dt(e){return e.binding}const lt=function(e){return(t,n,i)=>{const o=[];for(const[r,a]of i.propertyParams){const c=i.classMetadata.properties.get(r);if(void 0===c)throw new R(T.resolution,`Expecting metadata at property "${r.toString()}", none found`);c.kind!==x.unmanaged&&void 0!==a.bindings&&(n[r]=e(t,a),s(n[r])&&o.push((async()=>{n[r]=await n[r]})()))}if(o.length>0)return Promise.all(o).then(()=>{})}}(yt),ut=function(e){return function t(n,i){const o=[];for(const r of i.redirections)me(r)?o.push(...t(n,r)):o.push(e(n,r));return o}}(mt),pt=function(e,t,n){return(i,o)=>{const r=e(i,o);return s(r)?t(r,i,o):n(r,i,o)}}(function(e){return(t,n)=>{const i=[];for(const o of n.constructorParams)void 0===o?i.push(void 0):i.push(e(t,o));return i.some(s)?Promise.all(i):i}}(yt),function(e){return async(t,n,i)=>{const o=await t;return e(o,n,i)}}(st(lt)),st(lt)),ft=function(e){return(t,n)=>{const i=e(t,n);return s(i)?i.then(e=>n.binding.factory(...e)):n.binding.factory(...i)}}(function(e){return(t,n)=>{const i=[];for(const o of n.params)i.push(e(t,o));return i.some(s)?Promise.all(i):i}}(yt)),vt=(e=>nt(ct,e))(pt),gt=(e=>nt(dt,e))(ft);function ht(e){return yt(e,e.planResult.tree.root)}function mt(e,t){switch(t.binding.type){case l.ConstantValue:return et(e,t.binding);case l.DynamicValue:return it(e,t.binding);case l.Factory:return ot(e,t.binding);case l.Instance:return vt(e,t);case l.Provider:return at(e,t.binding);case l.ResolvedValue:return gt(e,t)}}function yt(e,t){if(void 0!==t.bindings)return Array.isArray(t.bindings)?function(e,t){const n=[];for(const i of t)me(i)?n.push(...ut(e,i)):n.push(mt(e,i));if(n.some(s))return Promise.all(n);return n}(e,t.bindings):function(e,t){if(me(t)){const n=ut(e,t);if(1===n.length)return n[0];throw new R(T.resolution,"Unexpected multiple resolved values on single injection")}return mt(e,t)}(e,t.bindings)}function Mt(e){return void 0!==e.scope}function It(e,t){if(void 0!==e.lifecycle.preDestroyMethodName&&"function"==typeof t[e.lifecycle.preDestroyMethodName])return t[e.lifecycle.preDestroyMethodName]()}function bt(e,t,n){const i=e.getDeactivations(t);if(void 0!==i)return s(n)?wt(n,i[Symbol.iterator]()):function(e,t){let n=t.next();for(;!0!==n.done;){const i=n.value(e);if(s(i))return wt(e,t);n=t.next()}}(n,i[Symbol.iterator]())}async function wt(e,t){const n=await e;let i=t.next();for(;!0!==i.done;)await i.value(n),i=t.next()}function Ct(e,t){const n=function(e,t){if(t.type===l.Instance){const n=e.getClassMetadata(t.implementationType),i=t.cache.value;return s(i)?i.then(e=>It(n,e)):It(n,i)}}(e,t);return void 0===n?St(e,t):n.then(()=>St(e,t))}function St(e,t){const n=t.cache;return s(n.value)?n.value.then(n=>Nt(e,t,n)):Nt(e,t,n.value)}function Nt(e,t,n){let i;if(void 0!==t.onDeactivation){i=(0,t.onDeactivation)(n)}return void 0===i?bt(e,t.serviceIdentifier,n):i.then(()=>bt(e,t.serviceIdentifier,n))}function Pt(e,t){if(void 0===t)return;const n=function(e){const t=[];for(const n of e)Mt(n)&&n.scope===d.Singleton&&n.cache.isRight&&t.push(n);return t}(t),i=[];for(const t of n){const n=Ct(e,t);void 0!==n&&i.push(n)}return i.length>0?Promise.all(i).then(()=>{}):void 0}function Rt(e,t){const n=e.getBindingsFromModule(t);return Pt(e,n)}function Tt(e,t){const n=e.getBindings(t);return Pt(e,n)}export{h as ActivationsService,I as BindingService,_e as CacheBindingInvalidationKind,x as ClassElementMetadataKind,b as DeactivationsService,We as PlanResultCacheService,de as ResolvedValueElementMetadataKind,d as bindingScopeValues,l as bindingTypeValues,w as decorate,c as getBindingId,j as getClassMetadata,z as inject,J as injectFromBase,G as injectable,Q as multiInject,ee as named,ne as optional,Oe as plan,ie as postConstruct,oe as preDestroy,ht as resolve,Pt as resolveBindingsDeactivations,Rt as resolveModuleDeactivations,Tt as resolveServiceDeactivations,re as tagged,ce as unmanaged};
|
|
1
|
+
import{getOwnReflectMetadata as e,setReflectMetadata as n,updateOwnReflectMetadata as t}from"@inversifyjs/reflect-metadata-utils";import{getBaseType as i}from"@inversifyjs/prototype-utils";import{stringifyServiceIdentifier as o,LazyServiceIdentifier as r,isPromise as s}from"@inversifyjs/common";const a="@inversifyjs/container/bindingId";function c(){const i=e(Object,a)??0;return i===Number.MAX_SAFE_INTEGER?n(Object,a,Number.MIN_SAFE_INTEGER):t(Object,a,()=>i,e=>e+1),i}const d={Request:"Request",Singleton:"Singleton",Transient:"Transient"},l={ConstantValue:"ConstantValue",DynamicValue:"DynamicValue",Factory:"Factory",Instance:"Instance",Provider:"Provider",ResolvedValue:"ResolvedValue",ServiceRedirection:"ServiceRedirection"};function*u(...e){for(const n of e)yield*n}class p{#e;#n;#t;constructor(e){this.#e=new Map,this.#n={};for(const n of Reflect.ownKeys(e))this.#n[n]=new Map;this.#t=e}add(e,n){this.#i(e).push(n);for(const t of Reflect.ownKeys(n))this.#o(t,n[t]).push(e)}clone(){const e=this.#r(),n=this.#s(),t=Reflect.ownKeys(this.#t),i=this._buildNewInstance(this.#t);this.#a(this.#e,i.#e,e,n);for(const n of t)this.#c(this.#n[n],i.#n[n],e);return i}get(e,n){return this.#n[e].get(n)}getAllKeys(e){return this.#n[e].keys()}removeByRelation(e,n){const t=this.get(e,n);if(void 0===t)return;const i=new Set(t);for(const t of i){const i=this.#e.get(t);if(void 0===i)throw new Error("Expecting model relation, none found");for(const o of i)o[e]===n&&this.#d(t,o);this.#e.delete(t)}}_buildNewInstance(e){return new p(e)}_cloneModel(e){return e}_cloneRelation(e){return e}#r(){const e=new Map;for(const n of this.#e.keys()){const t=this._cloneModel(n);e.set(n,t)}return e}#s(){const e=new Map;for(const n of this.#e.values())for(const t of n){const n=this._cloneRelation(t);e.set(t,n)}return e}#i(e){let n=this.#e.get(e);return void 0===n&&(n=[],this.#e.set(e,n)),n}#o(e,n){let t=this.#n[e].get(n);return void 0===t&&(t=[],this.#n[e].set(n,t)),t}#l(e,n){const t=n.get(e);if(void 0===t)throw new Error("Expecting model to be cloned, none found");return t}#u(e,n){const t=n.get(e);if(void 0===t)throw new Error("Expecting relation to be cloned, none found");return t}#c(e,n,t){for(const[i,o]of e){const e=new Array;for(const n of o)e.push(this.#l(n,t));n.set(i,e)}}#a(e,n,t,i){for(const[o,r]of e){const e=new Array;for(const n of r)e.push(this.#u(n,i));n.set(this.#l(o,t),e)}}#d(e,n){for(const t of Reflect.ownKeys(n))this.#p(e,t,n[t])}#p(e,n,t){const i=this.#n[n].get(t);if(void 0!==i){const o=i.indexOf(e);-1!==o&&i.splice(o,1),0===i.length&&this.#n[n].delete(t)}}}var f,v,g;!function(e){e.moduleId="moduleId",e.serviceId="serviceId"}(f||(f={}));class h{#f;#v;constructor(e,n){this.#f=n??new p({moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#v=e}static build(e){return new h(e)}add(e,n){this.#f.add(e,n)}clone(){return new h(this.#v,this.#f.clone())}get(e){const n=[],t=this.#f.get(f.serviceId,e);void 0!==t&&n.push(t);const i=this.#v()?.get(e);if(void 0!==i&&n.push(i),0!==n.length)return u(...n)}removeAllByModuleId(e){this.#f.removeByRelation(f.moduleId,e)}removeAllByServiceId(e){this.#f.removeByRelation(f.serviceId,e)}}function m(e){return e.isRight?{isRight:!0,value:e.value}:e}function y(e){switch(e.type){case l.ConstantValue:case l.DynamicValue:return function(e){return{cache:m(e.cache),id:e.id,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type,value:e.value}}(e);case l.Factory:return function(e){return{cache:m(e.cache),factory:e.factory,id:e.id,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type}}(e);case l.Instance:return function(e){return{cache:m(e.cache),id:e.id,implementationType:e.implementationType,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type}}(e);case l.Provider:return function(e){return{cache:m(e.cache),id:e.id,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,provider:e.provider,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type}}(e);case l.ResolvedValue:return function(e){return{cache:m(e.cache),factory:e.factory,id:e.id,isSatisfiedBy:e.isSatisfiedBy,metadata:e.metadata,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type}}(e);case l.ServiceRedirection:return function(e){return{id:e.id,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,serviceIdentifier:e.serviceIdentifier,targetServiceIdentifier:e.targetServiceIdentifier,type:e.type}}(e)}}!function(e){e.id="id",e.moduleId="moduleId",e.serviceId="serviceId"}(v||(v={}));class M extends p{_buildNewInstance(e){return new M(e)}_cloneModel(e){return y(e)}}class I{#g;#v;constructor(e,n){this.#g=n??new M({id:{isOptional:!1},moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#v=e}static build(e){return new I(e)}clone(){return new I(this.#v,this.#g.clone())}get(e){return this.getNonParentBindings(e)??this.#v()?.get(e)}*getChained(e){const n=this.getNonParentBindings(e);void 0!==n&&(yield*n);const t=this.#v();void 0!==t&&(yield*t.getChained(e))}getBoundServices(){const e=new Set(this.#g.getAllKeys(v.serviceId)),n=this.#v();if(void 0!==n)for(const t of n.getBoundServices())e.add(t);return e}getById(e){return this.#g.get(v.id,e)??this.#v()?.getById(e)}getByModuleId(e){return this.#g.get(v.moduleId,e)??this.#v()?.getByModuleId(e)}getNonParentBindings(e){return this.#g.get(v.serviceId,e)}getNonParentBoundServices(){return this.#g.getAllKeys(v.serviceId)}removeById(e){this.#g.removeByRelation(v.id,e)}removeAllByModuleId(e){this.#g.removeByRelation(v.moduleId,e)}removeAllByServiceId(e){this.#g.removeByRelation(v.serviceId,e)}set(e){const n={[v.id]:e.id,[v.serviceId]:e.serviceIdentifier};void 0!==e.moduleId&&(n[v.moduleId]=e.moduleId),this.#g.add(e,n)}}!function(e){e.moduleId="moduleId",e.serviceId="serviceId"}(g||(g={}));class b{#h;#v;constructor(e,n){this.#h=n??new p({moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#v=e}static build(e){return new b(e)}add(e,n){this.#h.add(e,n)}clone(){return new b(this.#v,this.#h.clone())}get(e){const n=[],t=this.#h.get(g.serviceId,e);void 0!==t&&n.push(t);const i=this.#v()?.get(e);if(void 0!==i&&n.push(i),0!==n.length)return u(...n)}removeAllByModuleId(e){this.#h.removeByRelation(g.moduleId,e)}removeAllByServiceId(e){this.#h.removeByRelation(g.serviceId,e)}}function w(e,n,t){const i=Array.isArray(e)?e:[e];if(void 0!==t)if("number"!=typeof t)Reflect.decorate(i,n.prototype,t);else for(const e of i)e(n,void 0,t);else Reflect.decorate(i,n)}const C="@inversifyjs/core/classMetadataReflectKey";function S(){return{constructorArguments:[],lifecycle:{postConstructMethodName:void 0,preDestroyMethodName:void 0},properties:new Map,scope:void 0}}const N="@inversifyjs/core/pendingClassMetadataCountReflectKey";const P=Symbol.for("@inversifyjs/core/InversifyCoreError");class R extends Error{[P];kind;constructor(e,n,t){super(n,t),this[P]=!0,this.kind=e}static is(e){return"object"==typeof e&&null!==e&&!0===e[P]}static isErrorOfKind(e,n){return R.is(e)&&e.kind===n}}var A,T,x;function j(n){const t=e(n,C)??S();if(!function(n){const t=e(n,N);return void 0!==t&&0!==t}(n))return function(e,n){const t=[];if(n.length<e.length)throw new R(A.missingInjectionDecorator,`Found unexpected missing metadata on type "${e.name}". "${e.name}" constructor requires at least ${e.length.toString()} arguments, found ${n.length.toString()} instead.\nAre you using @inject, @multiInject or @unmanaged decorators in every non optional constructor argument?\n\nIf you're using typescript and want to rely on auto injection, set "emitDecoratorMetadata" compiler option to true`);for(let e=0;e<n.length;++e)void 0===n[e]&&t.push(e);if(t.length>0)throw new R(A.missingInjectionDecorator,`Found unexpected missing metadata on type "${e.name}" at constructor indexes "${t.join('", "')}".\n\nAre you using @inject, @multiInject or @unmanaged decorators at those indexes?\n\nIf you're using typescript and want to rely on auto injection, set "emitDecoratorMetadata" compiler option to true`)}(n,t.constructorArguments),t;!function(e,n){const t=[];for(let i=0;i<n.constructorArguments.length;++i){const o=n.constructorArguments[i];void 0!==o&&o.kind!==T.unknown||t.push(` - Missing or incomplete metadata for type "${e.name}" at constructor argument with index ${i.toString()}.\nEvery constructor parameter must be decorated either with @inject, @multiInject or @unmanaged decorator.`)}for(const[i,o]of n.properties)o.kind===T.unknown&&t.push(` - Missing or incomplete metadata for type "${e.name}" at property "${i.toString()}".\nThis property must be decorated either with @inject or @multiInject decorator.`);if(0===t.length)throw new R(A.unknown,`Unexpected class metadata for type "${e.name}" with uncompletion traces.\nThis might be caused by one of the following reasons:\n\n1. A third party library is targeting inversify reflection metadata.\n2. A bug is causing the issue. Consider submiting an issue to fix it.`);throw new R(A.missingInjectionDecorator,`Invalid class metadata at type ${e.name}:\n\n${t.join("\n\n")}`)}(n,t)}function B(){return 0}function F(e){return n=>{void 0!==n&&n.kind===T.unknown&&t(e,N,B,e=>e-1)}}function k(e,n){return(...t)=>i=>{if(void 0===i)return e(...t);if(i.kind===x.unmanaged)throw new R(A.injectionDecoratorConflict,"Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found");return n(i,...t)}}function $(e){if(e.kind!==T.unknown&&!0!==e.isFromTypescriptParamType)throw new R(A.injectionDecoratorConflict,"Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found")}!function(e){e[e.injectionDecoratorConflict=0]="injectionDecoratorConflict",e[e.missingInjectionDecorator=1]="missingInjectionDecorator",e[e.planning=2]="planning",e[e.resolution=3]="resolution",e[e.unknown=4]="unknown"}(A||(A={})),function(e){e[e.unknown=32]="unknown"}(T||(T={})),function(e){e[e.multipleInjection=0]="multipleInjection",e[e.singleInjection=1]="singleInjection",e[e.unmanaged=2]="unmanaged"}(x||(x={}));const D=k(function(e,n,t){return e===x.multipleInjection?{chained:t?.chained??!1,kind:e,name:void 0,optional:!1,tags:new Map,value:n}:{kind:e,name:void 0,optional:!1,tags:new Map,value:n}},function(e,n,t,i){return $(e),n===x.multipleInjection?{...e,chained:i?.chained??!1,kind:n,value:t}:{...e,kind:n,value:t}});function V(e,n){return t=>{const i=t.properties.get(n);return t.properties.set(n,e(i)),t}}var E;function O(e,n,t,i){if(R.isErrorOfKind(i,A.injectionDecoratorConflict)){const o=function(e,n,t){if(void 0===t){if(void 0===n)throw new R(A.unknown,"Unexpected undefined property and index values");return{kind:E.property,property:n,targetClass:e.constructor}}return"number"==typeof t?{index:t,kind:E.parameter,targetClass:e}:{kind:E.method,method:n,targetClass:e}}(e,n,t);throw new R(A.injectionDecoratorConflict,`Unexpected injection error.\n\nCause:\n\n${i.message}\n\nDetails\n\n${function(e){switch(e.kind){case E.method:return`[class: "${e.targetClass.name}", method: "${e.method.toString()}"]`;case E.parameter:return`[class: "${e.targetClass.name}", index: "${e.index.toString()}"]`;case E.property:return`[class: "${e.targetClass.name}", property: "${e.property.toString()}"]`}}(o)}`,{cause:i})}throw i}function _(e,n){return(i,o,r)=>{try{void 0===r?function(e,n){const i=L(e,n);return(e,n)=>{t(e.constructor,C,S,V(i(e),n))}}(e,n)(i,o):"number"==typeof r?function(e,n){const i=L(e,n);return(e,n,o)=>{if(!function(e,n){return"function"==typeof e&&void 0===n}(e,n))throw new R(A.injectionDecoratorConflict,`Found an @inject decorator in a non constructor parameter.\nFound @inject decorator at method "${n?.toString()??""}" at class "${e.constructor.name}"`);t(e,C,S,function(e,n){return t=>{const i=t.constructorArguments[n];return t.constructorArguments[n]=e(i),t}}(i(e),o))}}(e,n)(i,o,r):function(e,n){const i=L(e,n);return(e,n,o)=>{if(!function(e){return void 0!==e.set}(o))throw new R(A.injectionDecoratorConflict,`Found an @inject decorator in a non setter property method.\nFound @inject decorator at method "${n.toString()}" at class "${e.constructor.name}"`);t(e.constructor,C,S,V(i(e),n))}}(e,n)(i,o,r)}catch(e){O(i,o,r,e)}}}function L(e,n){return t=>{const i=n(t);return n=>(i(n),e(n))}}function z(e){return _(D(x.singleInjection,e),F)}!function(e){e[e.method=0]="method",e[e.parameter=1]="parameter",e[e.property=2]="property"}(E||(E={}));const U="@inversifyjs/core/classIsInjectableFlagReflectKey";const K=[Array,BigInt,Boolean,Function,Number,Object,String];function q(n){const i=e(n,"design:paramtypes");void 0!==i&&t(n,C,S,function(e){return n=>(e.forEach((e,t)=>{var i;void 0!==n.constructorArguments[t]||(i=e,K.includes(i))||(n.constructorArguments[t]=function(e){return{isFromTypescriptParamType:!0,kind:x.singleInjection,name:void 0,optional:!1,tags:new Map,value:e}}(e))}),n)}(i))}function G(i){return o=>{!function(t){if(void 0!==e(t,U))throw new R(A.injectionDecoratorConflict,`Cannot apply @injectable decorator multiple times at class "${t.name}"`);n(t,U,!0)}(o),q(o),void 0!==i&&t(o,C,S,e=>({...e,scope:i}))}}function W(e,n,t){let i;return e.extendConstructorArguments??!0?(i=[...n.constructorArguments],t.constructorArguments.map((e,n)=>{i[n]=e})):i=t.constructorArguments,i}function X(e,n,t){let i;return i=e.extendProperties??!0?new Map(u(n.properties,t.properties)):t.properties,i}function H(e){return n=>{const i=j(e.type);t(n,C,S,function(e,n){const t=t=>({constructorArguments:W(e,n,t),lifecycle:t.lifecycle,properties:X(e,n,t),scope:t.scope});return t}(e,i))}}function J(e){return n=>{const t=i(n);if(void 0===t)throw new R(A.injectionDecoratorConflict,`Expected base type for type "${n.name}", none found.`);H({...e,type:t})(n)}}function Q(e){return n=>{const t=[];let o=i(n);for(;void 0!==o;){const e=o;t.push(e),o=i(e)}t.reverse();for(const i of t)H({...e,type:i})(n)}}function Y(e,n){return _(D(x.multipleInjection,e,n),F)}function Z(e){return n=>{void 0===n&&t(e,N,B,e=>e+1)}}function ee(e){return n=>{const t=n??{kind:T.unknown,name:void 0,optional:!1,tags:new Map};if(t.kind===x.unmanaged)throw new R(A.injectionDecoratorConflict,"Unexpected injection found. Found @unmanaged injection with additional @named, @optional, @tagged or @targetName injections");return e(t)}}function ne(e){const n=ee(function(e){return n=>{if(void 0!==n.name)throw new R(A.injectionDecoratorConflict,"Unexpected duplicated named decorator");return n.name=e,n}}(e));return _(n,Z)}function te(e){if(e.optional)throw new R(A.injectionDecoratorConflict,"Unexpected duplicated optional decorator");return e.optional=!0,e}function ie(){return _(ee(te),Z)}function oe(){return(e,n,i)=>{try{t(e.constructor,C,S,(o=n,e=>{if(void 0!==e.lifecycle.postConstructMethodName)throw new R(A.injectionDecoratorConflict,"Unexpected duplicated postConstruct decorator");return e.lifecycle.postConstructMethodName=o,e}))}catch(t){O(e,n,void 0,t)}var o}}function re(){return(e,n,i)=>{try{t(e.constructor,C,S,(o=n,e=>{if(void 0!==e.lifecycle.preDestroyMethodName)throw new R(A.injectionDecoratorConflict,"Unexpected duplicated preDestroy decorator");return e.lifecycle.preDestroyMethodName=o,e}))}catch(t){O(e,n,void 0,t)}var o}}function se(e,n){const t=ee(function(e,n){return t=>{if(t.tags.has(e))throw new R(A.injectionDecoratorConflict,"Unexpected duplicated tag decorator with existing tag");return t.tags.set(e,n),t}}(e,n));return _(t,Z)}function ae(){return{kind:x.unmanaged}}const ce=k(ae,function(e){if($(e),function(e){return void 0!==e.name||e.optional||e.tags.size>0}(e))throw new R(A.injectionDecoratorConflict,"Unexpected injection found. Found @unmanaged injection with additional @named, @optional, @tagged or @targetName injections");return ae()});function de(){return _(ce(),F)}var le;function ue(e){if(!(e instanceof Error))return!1;return e instanceof RangeError&&/stack space|call stack|too much recursion/i.test(e.message)||"InternalError"===e.name&&/too much recursion/.test(e.message)}function pe(e,n){if(ue(n)){const t=function(e){const n=[...e];if(0===n.length)return"(No dependency trace)";return n.map(o).join(" -> ")}(function(e){const n=new Set;for(const t of e.servicesBranch){if(n.has(t))return[...n,t];n.add(t)}return[...n]}(e));throw new R(A.planning,`Circular dependency found: ${t}`,{cause:n})}throw n}!function(e){e[e.multipleInjection=0]="multipleInjection",e[e.singleInjection=1]="singleInjection"}(le||(le={}));const fe=Symbol.for("@inversifyjs/core/LazyPlanServiceNode");class ve{[fe];_serviceIdentifier;_serviceNode;constructor(e,n){this[fe]=!0,this._serviceNode=e,this._serviceIdentifier=n}get bindings(){return this._getNode().bindings}get isContextFree(){return this._getNode().isContextFree}get serviceIdentifier(){return this._serviceIdentifier}set bindings(e){this._getNode().bindings=e}set isContextFree(e){this._getNode().isContextFree=e}static is(e){return"object"==typeof e&&null!==e&&!0===e[fe]}invalidate(){this._serviceNode=void 0}isExpanded(){return void 0!==this._serviceNode}_getNode(){return void 0===this._serviceNode&&(this._serviceNode=this._buildPlanServiceNode()),this._serviceNode}}class ge{#m;constructor(e){this.#m=e}get name(){return this.#m.elem.name}get serviceIdentifier(){return this.#m.elem.serviceIdentifier}get tags(){return this.#m.elem.tags}getAncestor(){if(this.#m.elem.getAncestorsCalled=!0,void 0!==this.#m.previous)return new ge(this.#m.previous)}}function he(e,n,t){const i=t?.customServiceIdentifier??n.serviceIdentifier,o=(!0===t?.chained?[...e.operations.getBindingsChained(i)]:[...e.operations.getBindings(i)??[]]).filter(e=>e.isSatisfiedBy(n));if(0===o.length&&void 0!==e.autobindOptions&&"function"==typeof i){const n=function(e,n){const t=j(n),i=t.scope??e.scope;return{cache:{isRight:!1,value:void 0},id:c(),implementationType:n,isSatisfiedBy:()=>!0,moduleId:void 0,onActivation:void 0,onDeactivation:void 0,scope:i,serviceIdentifier:n,type:l.Instance}}(e.autobindOptions,i);e.operations.setBinding(n),o.push(n)}return o}class me{last;constructor(e){this.last=e}concat(e){return new me({elem:e,previous:this.last})}[Symbol.iterator](){let e=this.last;return{next:()=>{if(void 0===e)return{done:!0,value:void 0};const n=e.elem;return e=e.previous,{done:!1,value:n}}}}}function ye(e){const n=new Map;return void 0!==e.rootConstraints.tag&&n.set(e.rootConstraints.tag.key,e.rootConstraints.tag.value),new me({elem:{getAncestorsCalled:!1,name:e.rootConstraints.name,serviceIdentifier:e.rootConstraints.serviceIdentifier,tags:n},previous:void 0})}function Me(e){return void 0!==e.redirections}function Ie(e,n,t,i){const r=t.elem.serviceIdentifier,s=t.previous?.elem.serviceIdentifier;Array.isArray(e)?function(e,n,t,i,r,s){if(0!==e.length){const n=s[s.length-1]??t,a=`Ambiguous bindings found for service: "${o(n)}".${Se(s)}\n\nRegistered bindings:\n\n${e.map(e=>function(e){switch(e.type){case l.Instance:return`[ type: "${e.type}", serviceIdentifier: "${o(e.serviceIdentifier)}", scope: "${e.scope}", implementationType: "${e.implementationType.name}" ]`;case l.ServiceRedirection:return`[ type: "${e.type}", serviceIdentifier: "${o(e.serviceIdentifier)}", redirection: "${o(e.targetServiceIdentifier)}" ]`;default:return`[ type: "${e.type}", serviceIdentifier: "${o(e.serviceIdentifier)}", scope: "${e.scope}" ]`}}(e.binding)).join("\n")}\n\nTrying to resolve bindings for "${we(t,i)}".${Ce(r)}`;throw new R(A.planning,a)}n||be(t,i,r,s)}(e,n,r,s,t.elem,i):function(e,n,t,i,o,r){void 0!==e||n||be(t,i,o,r)}(e,n,r,s,t.elem,i)}function be(e,n,t,i){const r=i[i.length-1]??e,s=`No bindings found for service: "${o(r)}".\n\nTrying to resolve bindings for "${we(e,n)}".${Se(i)}${Ce(t)}`;throw new R(A.planning,s)}function we(e,n){return void 0===n?`${o(e)} (Root service)`:o(n)}function Ce(e){const n=0===e.tags.size?"":`\n- tags:\n - ${[...e.tags.keys()].map(e=>e.toString()).join("\n - ")}`;return`\n\nBinding constraints:\n- service identifier: ${o(e.serviceIdentifier)}\n- name: ${e.name?.toString()??"-"}${n}`}function Se(e){return 0===e.length?"":`\n\n- service redirections:\n - ${e.map(e=>o(e)).join("\n - ")}`}function Ne(e,n,t,i){if(1===e.redirections.length){const[o]=e.redirections;return void(Me(o)&&Ne(o,n,t,[...i,o.binding.targetServiceIdentifier]))}Ie(e.redirections,n,t,i)}function Pe(e,n,t){if(Array.isArray(e.bindings)&&1===e.bindings.length){const[i]=e.bindings;return void(Me(i)&&Ne(i,n,t,[i.binding.targetServiceIdentifier]))}Ie(e.bindings,n,t,[])}function Re(e){return r.is(e)?e.unwrap():e}function Ae(e){return(n,t,i)=>{const o=Re(i.value),r=t.concat({getAncestorsCalled:!1,name:i.name,serviceIdentifier:o,tags:i.tags}),s=new ge(r.last),a=i.kind===x.multipleInjection&&i.chained,c=he(n,s,{chained:a}),d=[],l={bindings:d,isContextFree:!0,serviceIdentifier:o};if(d.push(...e(n,r,c,l,a)),l.isContextFree=!r.last.elem.getAncestorsCalled,i.kind===x.singleInjection){Pe(l,i.optional,r.last);const[e]=d;l.bindings=e}return l}}function Te(e){return(n,t,i)=>{const o=Re(i.value),r=t.concat({getAncestorsCalled:!1,name:i.name,serviceIdentifier:o,tags:i.tags}),s=new ge(r.last),a=i.kind===le.multipleInjection&&i.chained,c=he(n,s,{chained:a}),d=[],l={bindings:d,isContextFree:!0,serviceIdentifier:o};if(d.push(...e(n,r,c,l,a)),l.isContextFree=!r.last.elem.getAncestorsCalled,i.kind===le.singleInjection){Pe(l,i.optional,r.last);const[e]=d;l.bindings=e}return l}}function xe(e){const n=function(e){return(n,t,i)=>{const o={binding:t,classMetadata:n.operations.getClassMetadata(t.implementationType),constructorParams:[],propertyParams:new Map},r={autobindOptions:n.autobindOptions,node:o,operations:n.operations,servicesBranch:n.servicesBranch};return e(r,i)}}(e),t=function(e){return(n,t,i)=>{const o={binding:t,params:[]},r={autobindOptions:n.autobindOptions,node:o,operations:n.operations,servicesBranch:n.servicesBranch};return e(r,i)}}(e),i=(e,i,r,s,a)=>{const c=Me(s)?s.binding.targetServiceIdentifier:s.serviceIdentifier;e.servicesBranch.push(c);const d=[];for(const s of r)switch(s.type){case l.Instance:d.push(n(e,s,i));break;case l.ResolvedValue:d.push(t(e,s,i));break;case l.ServiceRedirection:{const n=o(e,i,s,a);d.push(n);break}default:d.push({binding:s})}return e.servicesBranch.pop(),d},o=function(e){return(n,t,i,o)=>{const r={binding:i,redirections:[]},s=he(n,new ge(t.last),{chained:o,customServiceIdentifier:i.targetServiceIdentifier});return r.redirections.push(...e(n,t,s,r,o)),r}}(i);return i}function je(e,n,t,i){if(void 0!==e&&(ve.is(t)&&!t.isExpanded()||t.isContextFree)){const i={tree:{root:t}};n.setPlan(e,i)}else n.setNonCachedServiceNode(t,i)}class Be extends ve{#y;#M;#I;#b;constructor(e,n,t,i,o){super(o,Re(i.value)),this.#M=n,this.#y=e,this.#I=t,this.#b=i}_buildPlanServiceNode(){return this.#M(this.#y,this.#I,this.#b)}}class Fe extends ve{#y;#w;#I;#C;constructor(e,n,t,i,o){super(o,Re(i.value)),this.#y=e,this.#w=n,this.#I=t,this.#C=i}_buildPlanServiceNode(){return this.#w(this.#y,this.#I,this.#C)}}function ke(e,n,t,i){const o=function(e,n){const t=function(e,n){return(t,i,o)=>{if(o.kind===x.unmanaged)return;const s=function(e){let n;if(0===e.tags.size)n=void 0;else{if(1!==e.tags.size)return;{const[t,i]=e.tags.entries().next().value;n={key:t,value:i}}}const t=r.is(e.value)?e.value.unwrap():e.value;return e.kind===x.multipleInjection?{chained:e.chained,isMultiple:!0,name:e.name,optional:e.optional,serviceIdentifier:t,tag:n}:{isMultiple:!1,name:e.name,optional:e.optional,serviceIdentifier:t,tag:n}}(o);if(void 0!==s){const e=t.operations.getPlan(s);if(void 0!==e&&e.tree.root.isContextFree)return e.tree.root}const a=n(t,i,o),c=new Be(t,e,i,o,a);return je(s,t.operations,c,{bindingConstraintsList:i,chainedBindings:o.kind===x.multipleInjection&&o.chained,optionalBindings:o.optional}),c}}(e,n);return(e,n,i)=>{const o=n.classMetadata;for(const[r,s]of o.constructorArguments.entries())n.constructorParams[r]=t(e,i,s);for(const[r,s]of o.properties){const o=t(e,i,s);void 0!==o&&n.propertyParams.set(r,o)}return e.node}}(e,t),s=function(e,n){const t=function(e,n){return(t,i,o)=>{const s=function(e){let n;if(0===e.tags.size)n=void 0;else{if(1!==e.tags.size)return;{const[t,i]=e.tags.entries().next().value;n={key:t,value:i}}}const t=r.is(e.value)?e.value.unwrap():e.value;return e.kind===le.multipleInjection?{chained:e.chained,isMultiple:!0,name:e.name,optional:e.optional,serviceIdentifier:t,tag:n}:{isMultiple:!1,name:e.name,optional:e.optional,serviceIdentifier:t,tag:n}}(o);if(void 0!==s){const e=t.operations.getPlan(s);if(void 0!==e&&e.tree.root.isContextFree)return e.tree.root}const a=n(t,i,o),c=new Fe(t,e,i,o,a);return je(s,t.operations,c,{bindingConstraintsList:i,chainedBindings:o.kind===le.multipleInjection&&o.chained,optionalBindings:o.optional}),c}}(e,n);return(e,n,i)=>{const o=n.binding.metadata;for(const[r,s]of o.arguments.entries())n.params[r]=t(e,i,s);return e.node}}(n,i);return(e,n)=>e.node.binding.type===l.Instance?o(e,e.node,n):s(e,e.node,n)}class $e extends ve{#y;constructor(e,n){super(n,n.serviceIdentifier),this.#y=e}_buildPlanServiceNode(){return _e(this.#y)}}const De=Ae(Oe),Ve=Te(Oe),Ee=xe(ke(De,Ve,De,Ve));function Oe(e,n,t,i,o){return Ee(e,n,t,i,o)}const _e=function(e){return n=>{const t=ye(n),i=new ge(t.last),o=n.rootConstraints.isMultiple&&n.rootConstraints.chained,r=he(n,i,{chained:o}),s=[],a={bindings:s,isContextFree:!0,serviceIdentifier:n.rootConstraints.serviceIdentifier};if(s.push(...e(n,t,r,a,o)),a.isContextFree=!t.last.elem.getAncestorsCalled,!n.rootConstraints.isMultiple){Pe(a,n.rootConstraints.isOptional??!1,t.last);const[e]=s;a.bindings=e}return a}}(Ee);function Le(e){try{const n=function(e){return e.rootConstraints.isMultiple?{chained:e.rootConstraints.chained,isMultiple:!0,name:e.rootConstraints.name,optional:e.rootConstraints.isOptional??!1,serviceIdentifier:e.rootConstraints.serviceIdentifier,tag:e.rootConstraints.tag}:{isMultiple:!1,name:e.rootConstraints.name,optional:e.rootConstraints.isOptional??!1,serviceIdentifier:e.rootConstraints.serviceIdentifier,tag:e.rootConstraints.tag}}(e),t=e.operations.getPlan(n);if(void 0!==t)return t;const i=_e(e),o={tree:{root:new $e(e,i)}};return e.operations.setPlan(n,o),o}catch(n){pe(e,n)}}var ze;!function(e){e.bindingAdded="bindingAdded",e.bindingRemoved="bindingRemoved"}(ze||(ze={}));class Ue{#S;#N;#P;constructor(){this.#S=[],this.#N=8,this.#P=1024}*[Symbol.iterator](){let e=0;for(const n of this.#S){const t=n.deref();void 0===t?++e:yield t}this.#S.length>=this.#N&&this.#R(e)&&this.#A(e)}push(e){const n=new WeakRef(e);if(this.#S.push(n),this.#S.length>=this.#N&&this.#S.length%this.#P===0){let e=0;for(const n of this.#S)void 0===n.deref()&&++e;this.#R(e)&&this.#A(e)}}#A(e){const n=new Array(this.#S.length-e);let t=0;for(const e of this.#S)e.deref()&&(n[t++]=e);this.#S=n}#R(e){return e>=.5*this.#S.length}}const Ke=xe(ke(De,Ve,function(e,n,t){return qe(e,n,t)},function(e,n,t){return Ge(e,n,t)})),qe=function(e){const n=Ae(e);return(e,t,i)=>{try{return n(e,t,i)}catch(e){if(R.isErrorOfKind(e,A.planning))return;throw e}}}(Ke),Ge=function(e){const n=Te(e);return(e,t,i)=>{try{return n(e,t,i)}catch(e){if(R.isErrorOfKind(e,A.planning))return;throw e}}}(Ke);function We(e,n,t,i,o){if(ve.is(n)&&!n.isExpanded())return{isContextFreeBinding:!0,shouldInvalidateServiceNode:!1};const r=new ge(i.last);return!t.isSatisfiedBy(r)||i.last.elem.getAncestorsCalled?{isContextFreeBinding:!i.last.elem.getAncestorsCalled,shouldInvalidateServiceNode:!1}:function(e,n,t,i,o){let r;try{[r]=Ke(e,i,[t],n,o)}catch(e){if(ue(e))return{isContextFreeBinding:!1,shouldInvalidateServiceNode:!0};throw e}return function(e,n){if(Array.isArray(e.bindings))e.bindings.push(n);else{if(void 0!==e.bindings){if(!ve.is(e))throw new R(A.planning,"Unexpected non-lazy plan service node. This is likely a bug in the planning logic. Please, report this issue");return{isContextFreeBinding:!0,shouldInvalidateServiceNode:!0}}e.bindings=n}return{isContextFreeBinding:!0,shouldInvalidateServiceNode:!1}}(n,r)}(e,n,t,i,o)}function Xe(e,n,t,i){if(ve.is(e)&&!e.isExpanded())return{bindingNodeRemoved:void 0,isContextFreeBinding:!0};const o=new ge(t.last);if(!n.isSatisfiedBy(o)||t.last.elem.getAncestorsCalled)return{bindingNodeRemoved:void 0,isContextFreeBinding:!t.last.elem.getAncestorsCalled};let r;if(Array.isArray(e.bindings))e.bindings=e.bindings.filter(e=>e.binding!==n||(r=e,!1));else if(e.bindings?.binding===n)if(r=e.bindings,i)e.bindings=void 0;else{if(!ve.is(e))throw new R(A.planning,"Unexpected non-lazy plan service node. This is likely a bug in the planning logic. Please, report this issue");e.invalidate()}return{bindingNodeRemoved:r,isContextFreeBinding:!0}}class He{#T;#x;#j;#B;#F;#k;constructor(){this.#T=new Map,this.#x=this.#$(),this.#j=this.#$(),this.#B=this.#$(),this.#F=this.#$(),this.#k=new Ue}clearCache(){for(const e of this.#D())e.clear();for(const e of this.#k)e.clearCache()}get(e){return void 0===e.name?void 0===e.tag?this.#V(this.#x,e).get(e.serviceIdentifier):this.#V(this.#F,e).get(e.serviceIdentifier)?.get(e.tag.key)?.get(e.tag.value):void 0===e.tag?this.#V(this.#j,e).get(e.serviceIdentifier)?.get(e.name):this.#V(this.#B,e).get(e.serviceIdentifier)?.get(e.name)?.get(e.tag.key)?.get(e.tag.value)}invalidateServiceBinding(e){this.#E(e),this.#O(e),this.#_(e),this.#L(e),this.#z(e);for(const n of this.#k)n.invalidateServiceBinding(e)}set(e,n){void 0===e.name?void 0===e.tag?this.#V(this.#x,e).set(e.serviceIdentifier,n):this.#U(this.#U(this.#V(this.#F,e),e.serviceIdentifier),e.tag.key).set(e.tag.value,n):void 0===e.tag?this.#U(this.#V(this.#j,e),e.serviceIdentifier).set(e.name,n):this.#U(this.#U(this.#U(this.#V(this.#B,e),e.serviceIdentifier),e.name),e.tag.key).set(e.tag.value,n)}setNonCachedServiceNode(e,n){let t=this.#T.get(e.serviceIdentifier);void 0===t&&(t=new Map,this.#T.set(e.serviceIdentifier,t)),t.set(e,n)}subscribe(e){this.#k.push(e)}#$(){const e=new Array(8);for(let n=0;n<e.length;++n)e[n]=new Map;return e}#K(e,n,t,i){const o=!!(2&n);let r;if(o){r={chained:!!(0&n),isMultiple:o,serviceIdentifier:e.binding.serviceIdentifier}}else r={isMultiple:o,serviceIdentifier:e.binding.serviceIdentifier};return!!(1&n)&&(r.isOptional=!0),void 0!==t&&(r.name=t),void 0!==i&&(r.tag=i),{autobindOptions:void 0,operations:e.operations,rootConstraints:r,servicesBranch:[]}}#U(e,n){let t=e.get(n);return void 0===t&&(t=new Map,e.set(n,t)),t}#V(e,n){return e[this.#q(n)]}#D(){return[this.#T,...this.#x,...this.#j,...this.#B,...this.#F]}#q(e){return e.isMultiple?(e.chained?4:0)|(e.optional?1:0)|2:e.optional?1:0}#O(e){for(const[n,t]of this.#j.entries()){const i=t.get(e.binding.serviceIdentifier);if(void 0!==i)for(const[t,o]of i.entries())this.#G(e,o,n,t,void 0)}}#_(e){for(const[n,t]of this.#B.entries()){const i=t.get(e.binding.serviceIdentifier);if(void 0!==i)for(const[t,o]of i.entries())for(const[i,r]of o.entries())for(const[o,s]of r.entries())this.#G(e,s,n,t,{key:i,value:o})}}#W(e){switch(e.binding.type){case l.ServiceRedirection:for(const n of e.redirections)this.#W(n);break;case l.Instance:for(const n of e.constructorParams)void 0!==n&&this.#X(n);for(const n of e.propertyParams.values())this.#X(n);break;case l.ResolvedValue:for(const n of e.params)this.#X(n)}}#X(e){const n=this.#T.get(e.serviceIdentifier);void 0!==n&&n.has(e)&&(n.delete(e),this.#H(e))}#H(e){if((!ve.is(e)||e.isExpanded())&&void 0!==e.bindings)if(Array.isArray(e.bindings))for(const n of e.bindings)this.#W(n);else this.#W(e.bindings)}#z(e){const n=this.#T.get(e.binding.serviceIdentifier);if(void 0!==n)switch(e.kind){case ze.bindingAdded:for(const[t,i]of n){const n=We({autobindOptions:void 0,operations:e.operations,servicesBranch:[]},t,e.binding,i.bindingConstraintsList,i.chainedBindings);n.isContextFreeBinding?n.shouldInvalidateServiceNode&&ve.is(t)&&(this.#H(t),t.invalidate()):this.clearCache()}break;case ze.bindingRemoved:for(const[t,i]of n){const n=Xe(t,e.binding,i.bindingConstraintsList,i.optionalBindings);n.isContextFreeBinding?void 0!==n.bindingNodeRemoved&&this.#W(n.bindingNodeRemoved):this.clearCache()}}}#E(e){for(const[n,t]of this.#x.entries()){const i=t.get(e.binding.serviceIdentifier);this.#G(e,i,n,void 0,void 0)}}#L(e){for(const[n,t]of this.#F.entries()){const i=t.get(e.binding.serviceIdentifier);if(void 0!==i)for(const[t,o]of i.entries())for(const[i,r]of o.entries())this.#G(e,r,n,void 0,{key:t,value:i})}}#G(e,n,t,i,o){if(void 0!==n&&ve.is(n.tree.root)){const c=this.#K(e,t,i,o);switch(e.kind){case ze.bindingAdded:{const t=(r=c,s=n.tree.root,a=e.binding,ve.is(s)&&!s.isExpanded()?{isContextFreeBinding:!0,shouldInvalidateServiceNode:!1}:We(r,s,a,ye(r),r.rootConstraints.isMultiple&&r.rootConstraints.chained));t.isContextFreeBinding?t.shouldInvalidateServiceNode&&(this.#H(n.tree.root),n.tree.root.invalidate()):this.clearCache()}break;case ze.bindingRemoved:{const t=function(e,n,t){return ve.is(n)&&!n.isExpanded()?{bindingNodeRemoved:void 0,isContextFreeBinding:!0}:Xe(n,t,ye(e),e.rootConstraints.isOptional??!1)}(c,n.tree.root,e.binding);t.isContextFreeBinding?void 0!==t.bindingNodeRemoved&&this.#W(t.bindingNodeRemoved):this.clearCache()}}}var r,s,a}}function Je(e,n){if(ue(n)){const t=function(e){const n=[...e];if(0===n.length)return"(No dependency trace)";return n.map(o).join(" -> ")}(function(e){const n=e.planResult.tree.root,t=[];function i(e){const n=t.indexOf(e);if(-1!==n){return[...t.slice(n),e].map(e=>e.serviceIdentifier)}t.push(e);try{for(const n of function(e){const n=[],t=e.bindings;if(void 0===t)return n;const i=e=>{if(Me(e))for(const n of e.redirections)i(n);else switch(e.binding.type){case l.Instance:{const t=e;for(const e of t.constructorParams)void 0!==e&&n.push(e);for(const e of t.propertyParams.values())n.push(e);break}case l.ResolvedValue:{const t=e;for(const e of t.params)n.push(e);break}}};if(Array.isArray(t))for(const e of t)i(e);else i(t);return n}(e)){const e=i(n);if(void 0!==e)return e}}finally{t.pop()}}return i(n)??[]}(e));throw new R(A.planning,`Circular dependency found: ${t}`,{cause:n})}throw n}function Qe(e,n){return s(n)?(e.cache={isRight:!0,value:n},n.then(n=>Ye(e,n))):Ye(e,n)}function Ye(e,n){return e.cache={isRight:!0,value:n},n}function Ze(e,n,t){const i=e.getActivations(n);return void 0===i?t:s(t)?en(e,t,i[Symbol.iterator]()):function(e,n,t){let i=n,o=t.next();for(;!0!==o.done;){const n=o.value(e.context,i);if(s(n))return en(e,n,t);i=n,o=t.next()}return i}(e,t,i[Symbol.iterator]())}async function en(e,n,t){let i=await n,o=t.next();for(;!0!==o.done;)i=await o.value(e.context,i),o=t.next();return i}function nn(e,n,t){let i=t;if(void 0!==n.onActivation){const t=n.onActivation;i=s(i)?i.then(n=>t(e.context,n)):t(e.context,i)}return Ze(e,n.serviceIdentifier,i)}function tn(e){return(n,t)=>{if(t.cache.isRight)return t.cache.value;return Qe(t,nn(n,t,e(n,t)))}}const on=tn(function(e,n){return n.value});function rn(e){return e}function sn(e,n){return(t,i)=>{const o=e(i);switch(o.scope){case d.Singleton:if(o.cache.isRight)return o.cache.value;return Qe(o,nn(t,o,n(t,i)));case d.Request:{if(t.requestScopeCache.has(o.id))return t.requestScopeCache.get(o.id);const e=nn(t,o,n(t,i));return t.requestScopeCache.set(o.id,e),e}case d.Transient:return nn(t,o,n(t,i))}}}const an=(e=>sn(rn,e))(function(e,n){return n.value(e.context)});const cn=tn(function(e,n){return n.factory(e.context)});function dn(e,n,t){const i=function(e,n,t){if(void 0===t)return;if(!(t in e))throw new R(A.resolution,`Expecting a "${t.toString()}" property when resolving "${n.implementationType.name}" class @postConstruct decorated method, none found.`);if("function"!=typeof e[t])throw new R(A.resolution,`Expecting a "${t.toString()}" method when resolving "${n.implementationType.name}" class @postConstruct decorated method, a non function property was found instead.`);{let i;try{i=e[t]()}catch(e){throw new R(A.resolution,`Unexpected error found when calling "${t.toString()}" @postConstruct decorated method on class "${n.implementationType.name}"`,{cause:e})}if(s(i))return async function(e,n,t){try{await t}catch(t){throw new R(A.resolution,`Unexpected error found when calling "${n.toString()}" @postConstruct decorated method on class "${e.implementationType.name}"`,{cause:t})}}(n,t,i)}}(e,n,t);return s(i)?i.then(()=>e):e}function ln(e){return(n,t,i)=>{const o=new i.binding.implementationType(...n),r=e(t,o,i);return s(r)?r.then(()=>dn(o,i.binding,i.classMetadata.lifecycle.postConstructMethodName)):dn(o,i.binding,i.classMetadata.lifecycle.postConstructMethodName)}}const un=tn(function(e,n){return n.provider(e.context)});function pn(e){return e.binding}function fn(e){return e.binding}const vn=function(e){return(n,t,i)=>{const o=[];for(const[r,a]of i.propertyParams){const c=i.classMetadata.properties.get(r);if(void 0===c)throw new R(A.resolution,`Expecting metadata at property "${r.toString()}", none found`);c.kind!==x.unmanaged&&void 0!==a.bindings&&(t[r]=e(n,a),s(t[r])&&o.push((async()=>{t[r]=await t[r]})()))}if(o.length>0)return Promise.all(o).then(()=>{})}}(wn),gn=function(e){return function n(t,i){const o=[];for(const r of i.redirections)Me(r)?o.push(...n(t,r)):o.push(e(t,r));return o}}(bn),hn=function(e,n,t){return(i,o)=>{const r=e(i,o);return s(r)?n(r,i,o):t(r,i,o)}}(function(e){return(n,t)=>{const i=[];for(const o of t.constructorParams)void 0===o?i.push(void 0):i.push(e(n,o));return i.some(s)?Promise.all(i):i}}(wn),function(e){return async(n,t,i)=>{const o=await n;return e(o,t,i)}}(ln(vn)),ln(vn)),mn=function(e){return(n,t)=>{const i=e(n,t);return s(i)?i.then(e=>t.binding.factory(...e)):t.binding.factory(...i)}}(function(e){return(n,t)=>{const i=[];for(const o of t.params)i.push(e(n,o));return i.some(s)?Promise.all(i):i}}(wn)),yn=(e=>sn(pn,e))(hn),Mn=(e=>sn(fn,e))(mn);function In(e){try{return wn(e,e.planResult.tree.root)}catch(n){Je(e,n)}}function bn(e,n){switch(n.binding.type){case l.ConstantValue:return on(e,n.binding);case l.DynamicValue:return an(e,n.binding);case l.Factory:return cn(e,n.binding);case l.Instance:return yn(e,n);case l.Provider:return un(e,n.binding);case l.ResolvedValue:return Mn(e,n)}}function wn(e,n){if(void 0!==n.bindings)return Array.isArray(n.bindings)?function(e,n){const t=[];for(const i of n)Me(i)?t.push(...gn(e,i)):t.push(bn(e,i));if(t.some(s))return Promise.all(t);return t}(e,n.bindings):function(e,n){if(Me(n)){const t=gn(e,n);if(1===t.length)return t[0];throw new R(A.resolution,"Unexpected multiple resolved values on single injection")}return bn(e,n)}(e,n.bindings)}function Cn(e){return void 0!==e.scope}function Sn(e,n){if(void 0!==e.lifecycle.preDestroyMethodName&&"function"==typeof n[e.lifecycle.preDestroyMethodName])return n[e.lifecycle.preDestroyMethodName]()}function Nn(e,n,t){const i=e.getDeactivations(n);if(void 0!==i)return s(t)?Pn(t,i[Symbol.iterator]()):function(e,n){let t=n.next();for(;!0!==t.done;){const i=t.value(e);if(s(i))return Pn(e,n);t=n.next()}}(t,i[Symbol.iterator]())}async function Pn(e,n){const t=await e;let i=n.next();for(;!0!==i.done;)await i.value(t),i=n.next()}function Rn(e,n){const t=function(e,n){if(n.type===l.Instance){const t=e.getClassMetadata(n.implementationType),i=n.cache.value;return s(i)?i.then(e=>Sn(t,e)):Sn(t,i)}}(e,n);return void 0===t?An(e,n):t.then(()=>An(e,n))}function An(e,n){const t=n.cache;return s(t.value)?t.value.then(t=>Tn(e,n,t)):Tn(e,n,t.value)}function Tn(e,n,t){let i;if(void 0!==n.onDeactivation){i=(0,n.onDeactivation)(t)}return void 0===i?Nn(e,n.serviceIdentifier,t):i.then(()=>Nn(e,n.serviceIdentifier,t))}function xn(e,n){if(void 0===n)return;const t=function(e){const n=[];for(const t of e)Cn(t)&&t.scope===d.Singleton&&t.cache.isRight&&n.push(t);return n}(n),i=[];for(const n of t){const t=Rn(e,n);void 0!==t&&i.push(t)}return i.length>0?Promise.all(i).then(()=>{}):void 0}function jn(e,n){const t=e.getBindingsFromModule(n);return xn(e,t)}function Bn(e,n){const t=e.getBindings(n);return xn(e,t)}export{h as ActivationsService,I as BindingService,ze as CacheBindingInvalidationKind,x as ClassElementMetadataKind,b as DeactivationsService,He as PlanResultCacheService,le as ResolvedValueElementMetadataKind,d as bindingScopeValues,l as bindingTypeValues,w as decorate,c as getBindingId,j as getClassMetadata,z as inject,J as injectFromBase,Q as injectFromHierarchy,G as injectable,Y as multiInject,ne as named,ie as optional,Le as plan,oe as postConstruct,re as preDestroy,In as resolve,xn as resolveBindingsDeactivations,jn as resolveModuleDeactivations,Bn as resolveServiceDeactivations,se as tagged,de as unmanaged};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|