@joist/di 3.1.2 → 3.1.3

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/README.md CHANGED
@@ -74,6 +74,25 @@ const car2 = factory2.get(Car);
74
74
  console.log(car2.accelerate(), car2.tires().size);
75
75
  ```
76
76
 
77
+ #### Factories
78
+
79
+ In addition to defining providers with classes you can also use factory functions.
80
+
81
+ ```ts
82
+ abstract class Logger {
83
+ abstract log(...args: any[]): void;
84
+ }
85
+
86
+ const app = new Injector([
87
+ {
88
+ provide: Logger,
89
+ factory() {
90
+ return console;
91
+ }
92
+ }
93
+ ]);
94
+ ```
95
+
77
96
  #### Custom Elements:
78
97
 
79
98
  Joist is built to work with custom elements. Since the document is a tree we can search up that tree for providers.
@@ -111,6 +130,7 @@ class MyElement extends HTMLElement {
111
130
  }
112
131
  }
113
132
 
133
+ // Note: To use parent providers, the parent elements need to be defined first in correct order!
114
134
  customElements.define('color-ctx', ColorCtx);
115
135
  customElements.define('my-element', MyElement);
116
136
  ```
@@ -125,6 +145,17 @@ customElements.define('my-element', MyElement);
125
145
  </color-ctx>
126
146
  ```
127
147
 
148
+ #### Environment
149
+
150
+ When using @joist/di with custom elements a default root injector is created dubbed 'environment'. This is the injector that all other injectors will eventually stop at.
151
+ If you need to define something in this environment you can do so with the `defineEnvironment` method.
152
+
153
+ ```ts
154
+ import { defineEnvironment } from '@joist/di';
155
+
156
+ defineEnvironment([{ provide: MyService, use: SomeOtherService }]);
157
+ ```
158
+
128
159
  #### No decorators no problem:
129
160
 
130
161
  While this library is built with decorators in mind it is designed so that it can be used without them.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joist/di",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "type": "module",
5
5
  "main": "./target/lib.js",
6
6
  "module": "./target/lib.js",
@@ -14,7 +14,7 @@ describe('environment', () => {
14
14
 
15
15
  it('should use the root injector when creating services', async () => {
16
16
  @injectable
17
- class MyService { }
17
+ class MyService {}
18
18
 
19
19
  @injectable
20
20
  class MyElement extends HTMLElement {
@@ -6,7 +6,7 @@ import { Injector } from './injector.js';
6
6
 
7
7
  describe('inject', () => {
8
8
  it('should work', () => {
9
- class HelloService { }
9
+ class HelloService {}
10
10
 
11
11
  @injectable
12
12
  class HelloWorld extends HTMLElement {
@@ -62,8 +62,8 @@ describe('inject', () => {
62
62
  provide: FooService,
63
63
  use: class extends FooService {
64
64
  value = '100';
65
- },
66
- },
65
+ }
66
+ }
67
67
  ]);
68
68
 
69
69
  expect(parent.get(BarService).foo().value).to.equal('100');
@@ -71,7 +71,7 @@ describe('@injectable()', () => {
71
71
  class Parent extends HTMLElement {
72
72
  static providers = [
73
73
  { provide: B, use: B },
74
- { provide: A, use: AltA },
74
+ { provide: A, use: AltA }
75
75
  ];
76
76
  }
77
77
 
@@ -6,7 +6,7 @@ import { injectable } from './injectable.js';
6
6
 
7
7
  describe('Injector', () => {
8
8
  it('should create a new instance of a single provider', () => {
9
- class A { }
9
+ class A {}
10
10
 
11
11
  const app = new Injector();
12
12
 
@@ -15,8 +15,8 @@ describe('Injector', () => {
15
15
  });
16
16
 
17
17
  it('should inject providers in the correct order', () => {
18
- class A { }
19
- class B { }
18
+ class A {}
19
+ class B {}
20
20
 
21
21
  @injectable
22
22
  class MyService {
@@ -32,7 +32,7 @@ describe('Injector', () => {
32
32
  });
33
33
 
34
34
  it('should create a new instance of a provider that has a full dep tree', () => {
35
- class A { }
35
+ class A {}
36
36
 
37
37
  @injectable
38
38
  class B {
@@ -61,21 +61,21 @@ describe('Injector', () => {
61
61
  });
62
62
 
63
63
  it('should override a provider if explicitly instructed', () => {
64
- class A { }
64
+ class A {}
65
65
 
66
66
  @injectable
67
67
  class B {
68
68
  a = inject(A);
69
69
  }
70
70
 
71
- class AltA extends A { }
71
+ class AltA extends A {}
72
72
  const app = new Injector([{ provide: A, use: AltA }]);
73
73
 
74
74
  expect(app.get(B).a()).to.be.instanceOf(AltA);
75
75
  });
76
76
 
77
77
  it('should return an existing instance from a parent injector', () => {
78
- class A { }
78
+ class A {}
79
79
 
80
80
  const parent = new Injector();
81
81
 
@@ -83,4 +83,66 @@ describe('Injector', () => {
83
83
 
84
84
  expect(parent.get(A)).to.equal(app.get(A));
85
85
  });
86
+
87
+ it('should use a factory if provided', () => {
88
+ class Service {
89
+ hello() {
90
+ return 'world';
91
+ }
92
+ }
93
+
94
+ const injector = new Injector([
95
+ {
96
+ provide: Service,
97
+ factory() {
98
+ return {
99
+ hello() {
100
+ return 'you';
101
+ }
102
+ };
103
+ }
104
+ }
105
+ ]);
106
+
107
+ expect(injector.get(Service).hello()).to.equal('you');
108
+ });
109
+
110
+ it('should throw an error if provider is missing both factory and use', () => {
111
+ class Service {
112
+ hello() {
113
+ return 'world';
114
+ }
115
+ }
116
+
117
+ const injector = new Injector([
118
+ {
119
+ provide: Service
120
+ }
121
+ ]);
122
+
123
+ expect(() => injector.get(Service)).to.throw(
124
+ "Provider for Service found but is missing either 'use' or 'factory'"
125
+ );
126
+ });
127
+
128
+ it('should pass factories and instance of the injector', (done) => {
129
+ class Service {
130
+ hello() {
131
+ return 'world';
132
+ }
133
+ }
134
+
135
+ const injector = new Injector([
136
+ {
137
+ provide: Service,
138
+ factory(i) {
139
+ expect(i).to.equal(injector);
140
+
141
+ done();
142
+ }
143
+ }
144
+ ]);
145
+
146
+ injector.get(Service);
147
+ });
86
148
  });
@@ -27,9 +27,12 @@ export class Injector {
27
27
  // ke track of isntances. One Token can have one instance
28
28
  #instances = new WeakMap<ProviderToken<any>, any>();
29
29
 
30
- #parent: Injector | undefined = undefined;
30
+ parent: Injector | undefined = undefined;
31
31
 
32
- constructor(public providers: Provider<any>[] = [], parent?: Injector) {
32
+ constructor(
33
+ public providers: Provider<any>[] = [],
34
+ parent?: Injector
35
+ ) {
33
36
  this.setParent(parent);
34
37
  }
35
38
 
@@ -44,27 +47,42 @@ export class Injector {
44
47
 
45
48
  // check for a provider definition
46
49
  if (provider) {
47
- return this.#createAndCache<T>(provider.use);
50
+ if (provider.use) {
51
+ const use = provider.use;
52
+
53
+ return this.#createAndCache<T>(token, () => new use());
54
+ } else if (provider.factory) {
55
+ const factory = provider.factory;
56
+
57
+ return this.#createAndCache<T>(token, factory);
58
+ } else {
59
+ throw new Error(
60
+ `Provider for ${token.name} found but is missing either 'use' or 'factory'`
61
+ );
62
+ }
48
63
  }
49
64
 
50
65
  // check for a parent and attempt to get there
51
- if (this.#parent) {
52
- return this.#parent.get(token);
66
+ if (this.parent) {
67
+ return this.parent.get(token);
53
68
  }
54
69
 
55
- return this.#createAndCache(token);
70
+ return this.#createAndCache(token, () => new token());
56
71
  }
57
72
 
58
73
  setParent(parent: Injector | undefined) {
59
- this.#parent = parent;
74
+ this.parent = parent;
60
75
  }
61
76
 
62
77
  clear() {
63
78
  this.#instances = new WeakMap();
64
79
  }
65
80
 
66
- #createAndCache<T extends Injectable>(token: ProviderToken<T>): T {
67
- const instance = new token();
81
+ #createAndCache<T extends Injectable>(
82
+ token: ProviderToken<T>,
83
+ factory: (injector: Injector) => T
84
+ ): T {
85
+ const instance = factory(this);
68
86
 
69
87
  this.#instances.set(token, instance);
70
88
 
@@ -1,10 +1,13 @@
1
+ import { Injector } from './injector.js';
2
+
1
3
  export type ProviderToken<T> = {
2
4
  providers?: Provider<any>[];
3
5
 
4
- new(...args: any[]): T;
6
+ new (...args: any[]): T;
5
7
  };
6
8
 
7
9
  export interface Provider<T> {
8
10
  provide: ProviderToken<T>;
9
- use: ProviderToken<T>;
11
+ use?: ProviderToken<T>;
12
+ factory?(injector: Injector): T;
10
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"environment.test.js","sourceRoot":"","sources":["../../src/lib/environment.test.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EA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E,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAE5B,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAClD,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qDAAqD,EAAE,KAAK,IAAI,EAAE;YAE7D,SAAS;oCADd,UAAU;;;;;;;;oBACX,6KAAkB;;;oBAAZ,uDAAS;;;;;YAGT,SAAS;oCADd,UAAU;;;;8BACa,WAAW;iCAAnB,SAAQ,WAAW;;;;oBAAnC,6KAEC;;;oBAFK,uDAAS;;gBACb,EAAE,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;;;;QAGzB,cAAc,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAE1C,MAAM,EAAE,GAAG,MAAM,OAAO,CAAY,IAAI,CAAA,iBAAiB,CAAC,CAAC;QAE3D,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -91,8 +91,8 @@ describe('inject', () => {
91
91
  provide: FooService,
92
92
  use: class extends FooService {
93
93
  value = '100';
94
- },
95
- },
94
+ }
95
+ }
96
96
  ]);
97
97
  expect(parent.get(BarService).foo().value).to.equal('100');
98
98
  });
@@ -1 +1 @@
1
- {"version":3,"file":"inject.test.js","sourceRoot":"","sources":["../../src/lib/inject.test.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MA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GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -110,7 +110,7 @@ describe('@injectable()', () => {
110
110
  }
111
111
  static providers = [
112
112
  { provide: B, use: B },
113
- { provide: A, use: AltA },
113
+ { provide: A, use: AltA }
114
114
  ];
115
115
  static {
116
116
  __runInitializers(_classThis, _classExtraInitializers);
@@ -13,12 +13,22 @@ export class Injector {
13
13
  }
14
14
  const provider = this.#findProvider(token);
15
15
  if (provider) {
16
- return this.#createAndCache(provider.use);
16
+ if (provider.use) {
17
+ const use = provider.use;
18
+ return this.#createAndCache(token, () => new use());
19
+ }
20
+ else if (provider.factory) {
21
+ const factory = provider.factory;
22
+ return this.#createAndCache(token, factory);
23
+ }
24
+ else {
25
+ throw new Error(`Provider for ${token.name} found but is missing either 'use' or 'factory'`);
26
+ }
17
27
  }
18
28
  if (this.#parent) {
19
29
  return this.#parent.get(token);
20
30
  }
21
- return this.#createAndCache(token);
31
+ return this.#createAndCache(token, () => new token());
22
32
  }
23
33
  setParent(parent) {
24
34
  this.#parent = parent;
@@ -26,8 +36,8 @@ export class Injector {
26
36
  clear() {
27
37
  this.#instances = new WeakMap();
28
38
  }
29
- #createAndCache(token) {
30
- const instance = new token();
39
+ #createAndCache(token, factory) {
40
+ const instance = factory(this);
31
41
  this.#instances.set(token, instance);
32
42
  const injector = INJECTABLES.get(instance);
33
43
  if (injector) {
@@ -1 +1 @@
1
- {"version":3,"file":"injector.js","sourceRoot":"","sources":["../../src/lib/injector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAyB9C,MAAM,OAAO,QAAQ;IAMA;IAJnB,UAAU,GAAG,IAAI,OAAO,EAA2B,CAAC;IAEpD,OAAO,GAAyB,SAAS,CAAC;IAE1C,YAAmB,YAA6B,EAAE,EAAE,MAAiB;QAAlD,c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;YACpB,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC/C,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,KAAK,KAAK,EAAE,CAAC;gBACxC,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;YAC3B,CAAC;QACH,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"}
@@ -152,5 +152,55 @@ describe('Injector', () => {
152
152
  const app = new Injector([], parent);
153
153
  expect(parent.get(A)).to.equal(app.get(A));
154
154
  });
155
+ it('should use a factory if provided', () => {
156
+ class Service {
157
+ hello() {
158
+ return 'world';
159
+ }
160
+ }
161
+ const injector = new Injector([
162
+ {
163
+ provide: Service,
164
+ factory() {
165
+ return {
166
+ hello() {
167
+ return 'you';
168
+ }
169
+ };
170
+ }
171
+ }
172
+ ]);
173
+ expect(injector.get(Service).hello()).to.equal('you');
174
+ });
175
+ it('should throw an error if provider is missing both factory and use', () => {
176
+ class Service {
177
+ hello() {
178
+ return 'world';
179
+ }
180
+ }
181
+ const injector = new Injector([
182
+ {
183
+ provide: Service
184
+ }
185
+ ]);
186
+ expect(() => injector.get(Service)).to.throw("Provider for Service found but is missing either 'use' or 'factory'");
187
+ });
188
+ it('should pass factories and instance of the injector', (done) => {
189
+ class Service {
190
+ hello() {
191
+ return 'world';
192
+ }
193
+ }
194
+ const injector = new Injector([
195
+ {
196
+ provide: Service,
197
+ factory(i) {
198
+ expect(i).to.equal(injector);
199
+ done();
200
+ }
201
+ }
202
+ ]);
203
+ injector.get(Service);
204
+ });
155
205
  });
156
206
  //# sourceMappingURL=injector.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"injector.test.js","sourceRoot":"","sources":["../../src/lib/injector.test.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAA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ers?: Provider<any>[];
3
4
  new (...args: any[]): T;
4
5
  };
5
6
  export interface Provider<T> {
6
7
  provide: ProviderToken<T>;
7
- use: ProviderToken<T>;
8
+ use?: ProviderToken<T>;
9
+ factory?(injector: Injector): T;
8
10
  }
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../node_modules/typescript/lib/lib.scripthost.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/typescript/lib/lib.es2022.full.d.ts","../../../node_modules/tslib/tslib.d.ts","../src/lib/provider.ts","../src/lib/injector.ts","../src/lib/environment.ts","../src/lib/injectable.ts","../src/lib.ts","../../../node_modules/@types/chai/index.d.ts","../../../node_modules/@open-wc/semantic-dom-diff/get-diffable-html.d.ts","../../../node_modules/@open-wc/semantic-dom-diff/chai-dom-diff-plugin.d.ts","../../../node_modules/@open-wc/semantic-dom-diff/chai-dom-diff.d.ts","../../../node_modules/@open-wc/semantic-dom-diff/index.d.ts","../../../node_modules/chai-a11y-axe/chai-a11y-axe-plugin.d.ts","../../../node_modules/chai-a11y-axe/src/accessible.d.ts","../../../node_modules/chai-a11y-axe/index.d.ts","../../../node_modules/@types/chai-dom/index.d.ts","../../../node_modules/@sinonjs/fake-timers/types/fake-timers-src.d.ts","../../../node_modules/@types/sinon/index.d.ts","../../../node_modules/@types/sinon-chai/index.d.ts","../../../node_modules/@open-wc/testing/register-chai-plugins.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/elementUpdated.d.ts","../../../node_modules/@types/trusted-types/lib/index.d.ts","../../../node_modules/@types/trusted-types/index.d.ts","../../../node_modules/lit-html/directive.d.ts","../../../node_modules/lit-html/lit-html.d.ts","../../../node_modules/lit-html/static.d.ts","../../../node_modules/@lit/reactive-element/css-tag.d.ts","../../../node_modules/@lit/reactive-element/reactive-controller.d.ts","../../../node_modules/@lit/reactive-element/reactive-element.d.ts","../../../node_modules/lit-element/lit-element.d.ts","../../../node_modules/lit-html/is-server.d.ts","../../../node_modules/lit/index.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/renderable.d.ts","../../../node_modules/@open-wc/dedupe-mixin/index.d.ts","../../../node_modules/@open-wc/scoped-elements/types/src/types.d.ts","../../../node_modules/@open-wc/scoped-elements/types/src/ScopedElementsMixin.d.ts","../../../node_modules/@open-wc/scoped-elements/types/index.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/fixture-no-side-effect.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/fixture.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/fixtureWrapper.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/helpers.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/scopedElementsWrapper.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/litFixture.d.ts","../../../node_modules/@open-wc/testing-helpers/types/src/stringFixture.d.ts","../../../node_modules/@open-wc/testing-helpers/types/index.d.ts","../../../node_modules/@open-wc/testing/index.d.ts","../src/lib/environment.test.ts","../src/lib/injectable.test.ts","../src/lib/injector.test.ts","../typings.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/@types/accepts/index.d.ts","../../../node_modules/@types/babel__code-frame/index.d.ts","../../../node_modules/@types/connect/index.d.ts","../../../node_modules/@types/body-parser/index.d.ts","../../../node_modules/@types/qs/index.d.ts","../../../node_modules/@types/co-body/index.d.ts","../../../node_modules/@types/command-line-args/index.d.ts","../../../node_modules/@types/content-disposition/index.d.ts","../../../node_modules/@types/convert-source-map/index.d.ts","../../../node_modules/@types/keygrip/index.d.ts","../../../node_modules/@types/range-parser/index.d.ts","../../../node_modules/@types/express-serve-static-core/index.d.ts","../../../node_modules/@types/mime/index.d.ts","../../../node_modules/@types/serve-static/index.d.ts","../../../node_modules/@types/express/index.d.ts","../../../node_modules/@types/cookies/index.d.ts","../../../node_modules/@types/debounce/index.d.ts","../../../node_modules/@types/estree/index.d.ts","../../../node_modules/@types/http-assert/index.d.ts","../../../node_modules/@types/http-errors/index.d.ts","../../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../../node_modules/@types/istanbul-lib-report/index.d.ts","../../../node_modules/@types/istanbul-reports/index.d.ts","../../../node_modules/@types/koa-compose/index.d.ts","../../../node_modules/@types/koa/index.d.ts","../../../node_modules/@types/mocha/index.d.ts","../../../node_modules/@types/parse5/lib/tree-adapters/default.d.ts","../../../node_modules/@types/parse5/index.d.ts","../../../node_modules/@types/resolve/index.d.ts","../../../node_modules/@types/ws/index.d.ts","../../../node_modules/@types/yauzl/index.d.ts"],"fileInfos":[{"version":"6a6b471e7e43e15ef6f8fe617a22ce4ecb0e34efa6c3dfcfe7cebd392bcca9d2","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","27147504487dc1159369da4f4da8a26406364624fa9bc3db632f7d94a5bae2c3","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc",{"version":"fcd3ecc9f764f06f4d5c467677f4f117f6abf49dee6716283aa204ff1162498b","affectsGlobalScope":true},{"version":"9a60b92bca4c1257db03b349d58e63e4868cfc0d1c8d0ba60c2dbc63f4e6c9f6","affectsGlobalScope":true},{"version":"c5c5565225fce2ede835725a92a28ece149f83542aa4866cfb10290bff7b8996","affectsGlobalScope":true},{"version":"7d2dbc2a0250400af0809b0ad5f84686e84c73526de931f84560e483eb16b03c","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"5114a95689b63f96b957e00216bc04baf9e1a1782aa4d8ee7e5e9acbf768e301","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"ab22100fdd0d24cfc2cc59d0a00fc8cf449830d9c4030dc54390a46bd562e929","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"36ae84ccc0633f7c0787bc6108386c8b773e95d3b052d9464a99cd9b8795fbec","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"61ed9b6d07af959e745fb11f9593ecd743b279418cc8a99448ea3cd5f3b3eb22","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"b7feb7967c6c6003e11f49efa8f5de989484e0a6ba2e5a6c41b55f8b8bd85dba","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"189c0703923150aa30673fa3de411346d727cc44a11c75d05d7cf9ef095daa22","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"1df2366de6650547b3dc1d7c4147355c0f6b4729c964e3839636fa418982d131","f1c9fe42b65437a61104e601eb298c5c859fb522b483f1bdb700eed67a16f980",{"version":"6dc1263aa5c18b17c95214a7cefce004f0477c82c24429b38a216c714063385c","signature":"b4614f8f260483399e24b7d1f2f271cf03a3d452b907774cc00a8d36210e0c21"},{"version":"83b57e03c8a26fbdae50f8b0ea779f35ee040ca9d99a4253430e267fcc769678","signature":"01cda5d9cc5e5488c2361950d091929065d0f09d0ed7100d3259d13963910751"},{"version":"b435fd56b9ae1223043094b0b2ed3c2ce738c5db807752b6d01ee1be0600f5c2","signature":"778172c20e843724317d2c18da4b8f465069a97b9ddeae374ceafe391de48387"},{"version":"a02c85a290c4985308fce93aaa2b88b896eeb12c6ba79e51b741ea8dc3f5e620","signature":"fd56568da29972fb6ad487af814c75f6492acc628e743509fca09a733296aa15"},"009bc62f4269bfac6cf04778b8d8a2693c5ecfd088a746f5db2fc66dc6fd75b2",{"version":"3a15910b7f45dfc393f010ee8f913580b08d65752800fc48147ea13445acd5f7","affectsGlobalScope":true},"72bee526b949b9932edba50997ff3b9cdede7b314d790d5f0d94f3d2944930ea",{"version":"75cd6dce1c5f87511772c891de86d0c9e6829e6273dea9f92a5bec9d0479d1e7","affectsGlobalScope":true},{"version":"cd711db43a952f15464b571ac11b7a440332cd52342bc92c4bf908c70688f57f","affectsGlobalScope":true},"9d8709c916778cb34830708ed47b78e9a46d1fb2eb73a682b14eee990bed4aa6",{"version":"5d90911f942229eb9049feab241739a5ced76f137948f8f42a615e5f01d4e7ea","affectsGlobalScope":true},"999a90d30a3183dcee987d0a5a7c586aba5bacbf6ce087ba8635124082ccfeea","8a5878edd52f4a720560b4c6e6247e9ddc3df6118ad9cf2f9927903b03d5f440",{"version":"4cdd1b520504f86d680470dc91baa79d625fa20e1f9dc1f99eba242eae9fada4","affectsGlobalScope":true},"6b40029289530423f407a22755c85b81740f9acfd88d2b53564f8c1657c26660","50a5b297e6c91df4f6068d98467a5e7ba4eeb888b9376757734dd4b1dfcdacd4",{"version":"b644a9e5433c651fb751aeb6e06f24dfa5604950d948622dcd2980b782bb1f50","affectsGlobalScope":true},"65b91a3725399231d3469529b5e27b85bf2aa98013e607f308e5fe260b47eeff","04e3793f33c71ceae20a4719698c068b72c98cf925b3c5f8a33096c00ed44258","2fcd2d22b1f30555e785105597cd8f57ed50300e213c4f1bbca6ae149f782c38",{"version":"3c150a2e1758724811db3bdc5c773421819343b1627714e09f29b1f40a5dfb26","affectsGlobalScope":true},"7000ec8572390d035ba5ef993953957150d0c38ffb31b56653c97dd78cb6e1aa","5a4af5e4727864a08625d5c892d7cba8916d205c7f0c68e15eda5d6579968497","bbc354c6a2740b087f1139e88e90309de480c5390362e2f0d32a145d8d7cf539","e59262ddaae67dec2d226f8a5d05cf6c4dc353c0d9b1e4980a61d7fcf9a2b051","5e30131b6a5587fe666926ad1d9807e733c0a597ed12d682669fcaa331aea576","d27ead0e913b4225279e8beb10450ecaf54af5ed145a6ecbbed18bb130815006","4ddf3962990379d1ea59b369a5516c7533b7944010d6998e0e9b1ab35d5af1f0","1bcd560deed90a43c51b08aa18f7f55229f2e30974ab5ed1b7bb5721be379013","dc08fe04e50bc24d1baded4f33e942222bbdd5d77d6341a93cfe6e4e4586a3be","605e0f5adf8993110c06c775e2a59b7774d1e7a99fc9657140380bab005063bc","88cda4269c54f0803834fd62b2fac61af8bff7a085693f7ca9df85c1f19dee8a",{"version":"d40075d9f1c08b4a8d8e468076f5258900e99895e7259c40f3923b7044bbed6c","affectsGlobalScope":true},"47a20e497d83cd84ad0aa5363200003f08f850fa819339044e03399941eef063","ade0d37a4c1d1abede2abf2591b7cc6347892ea53d4a39bf44a25fb6f707822f","eefa12914a21dafe4352e79866599498b73b3bd232d19854932f58ef36303fb0","d7840fd94e6dfb5b0d9df5a20fe1e79c8dd72b1efdb74d2ef04c31e3588c6b5b","fa6d684e15fe6e99c7208a51b45c04f8e0147f1c8587871aac48fff55b7b1f24","26a3d4bf5351a0034f4203d42946ef5308b22919ba2f26a3ecb976a17c714d83","735eca4958f164c1121f08f9de89352e6f75a56c1533ceefeae075c085799618","d5b69429138b2fb26076427c630064a71c12959263ec3d92cbec54baf89354e1","793fca6322a14fa8fa6bc6a4fc694fd7bcc88922c4f9abcd48bf6908f8bf939b","0b2b7cb8164fcc6f4a71c1bf47c2cd4828c867f0ec19d178bb20954348de9a30","e5fefd2fe7d4d459dadbc1384a3643fb7598e5f41ea97a411c0155447d9f71e5",{"version":"d23ae90a3f21462f9850e040ac3214b25655c02c521e8f1906ed78cd342947ff","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"95d7e79d194045bb2fd05b806458d06a851bbbd0c42dc2424e8154ea70254426","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"286d36b01d4bcbcf297148fc8f85084a400ba2d2b437dd57a0e1b6c1e331985c","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"741351edfd1ed1d70e96cf4219b75797459201efe6f21802f13f2a5598d74859","affectsGlobalScope":true},"66a6e7b6e32eea099615d627028ed0d681679e31237df03e68e1b912e3e61da0","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"f749812878fecfa53cfc13b36e5d35086fb6377983a9df44175da83ccc23af1f","affectsGlobalScope":true},"fd536fe411f46ae62c4729e342a3494adbdd54335e41039c238170c9781da9ff",{"version":"772ff00e189d93488d1ca6f0f4dfba77bd090a99ed31e19a14bc16fad4078e48","affectsGlobalScope":true},"d9b1fa0da9fbff85402c3ee794bcfe6d7cfef2fa053761b7d83989cdb7f9b26d","ac0c7cb0a4c1bec60be2c0460b3bda1e674eaf2c98312d7b6f16a0bb58718e2d",{"version":"7e2181a6fc140b4525d5a45c204477c37fa78a635558e88552c68f76a4325403","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","6a6bfa45d3ed96dea1ad653444fb26ddaa9245d2e2d6ddaab050cb9a2c0936d7","276b547eeb8eeeee9a446a3bfa6e07d1c0199269bdcf33813abab1281394a9cb","c999f7816955f75b447823e3e4085f699600e2a4a3327907df9af65b0a9c0df6","958df89fdcf5555cdfd57a14037e05505048dd29c59e8009bea279b65523b241","ffa8324a4c0611f9a50262fb36f097eeabe0fa0d71755aa67156da13cde1b932","9b814e0806922056145bedb096f11b73bdce70cc871f3ccfc4ce00b2cba75718",{"version":"6b526a5ec4a401ca7c26cfe6a48e641d8f30af76673bad3b06a1b4504594a960","affectsGlobalScope":true},{"version":"be3d24f3fd8c85fedd91485b207d180f14ac2602805b52f6a33462ada14c27b0","affectsGlobalScope":true},"e58cfbe7db26c2077027662ef6c87a3cf9d721717e77ecaa98c4d8d7911b3299","2ad6a251b6ef19fd1f8498f83bb7b265033bd52287e1f6569d09544f18806713","bfa08f2c30c475aef1c9451855ba6b2acfdc64f61950a38fae75806d66fb85c2","159807eb55a9439f9a675bd493788190a6203b5f36c315f8c3acbfcb875c7072","fe31b2b31ac5453fc7b8eef32b62017e55b214ceb884f0b177f442af92e84682","dd72576c8ea64d55af46a386068503d3cfcecce84ed7e1cbd4ff4081ba67fafc",{"version":"125af9d85cb9d5e508353f10a8d52f01652d2d48b2cea54789a33e5b4d289c1c","affectsGlobalScope":true},"70a7e8a7880d55396285e4b85ff5bdf3af3083176abe07f944967836f2a43188","3570df7c6f3a976109f55b596a2d88c2f87e0574cd1502272594ee5c4e56d0ef","850e95721334c2aa7697b08782f443ec4286274e5024169d4443933544f359d7",{"version":"74e6cd21f7b5e29fab05060ea24e2b90aa254f16f3f62ccd7055bdb8fc7b2ff5","affectsGlobalScope":true},{"version":"5761c90b0cabdd6bd1f5fb1c3bf942088fdd39e18ed35dbe39b0c34bc733bf13","affectsGlobalScope":true},"1eb6c5569d41e6021832d0a8a71f45fecbc13d03ad7d306da485999148b64955","c05ef0ecf06540ad3039515c10d3b27f9380639ced40f4093fd073e1b5ff21d9","c774096c5935712de41c763e3c08a04b7a788a85fb07a0c2df23fb5ace3bc610","2b847f2aba41dcd69677684d5d300c08aea4e306c305fd39bf548cef19f03cfe","f4c0cbc93eb51fd61e07a86111739770dd524f6297bd83266ff004aec553e085","9a134dbb29f0af914d90b23f609b39019d66ed53db7d492ab6b04c67114559da","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","785e5be57d4f20f290a20e7b0c6263f6c57fd6e51283050756cef07d6d651c68","44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","7b3781fbdfddbee8dba55ccee5aa74a7c8d6701ade11d49ab7d8cb1fcefe669e","c4aab2ec3a249f2a4caa9cbdb099752a80daf999b79d85aa3504cdfd6e559476",{"version":"2cff47e15621f3055af1df1547426f833c9d0a571750c4f0659836f45c50fe0a","affectsGlobalScope":true},"ad08154d9602429522cac965a715fde27d421d69b24756c5d291877dda75353e","c764a6cf523d13f2304a23216cd1084e28c041eebabd8aa9b2a9d99866c668c0","1272a5c2bd05961adc473e905332b7a422b00485c10b41c752f7fcf6835e3436","30ef92bf8135ce36ba1231fe41715276f2a40be72a478ddeb862bc16672e8680",{"version":"4ace0a30a70fe5963442d75ea6e69f525671ae76f6e57ab7556c44839b4237e8","affectsGlobalScope":true},{"version":"a6f03dbf03c001fb3ac1c9bea6dde049dfff27ef8886cc4a886374aacf2e997d","affectsGlobalScope":true},"66bfb3de947abf4b117ee849c245425dbe494d6903e28f9ded566e91c9d05d77","c28d4f58131b93d60e087b86148d4e0c9d9b5c49c23ff1a9d1a9594fdedd5d08","c6b5d7f259544c91024ecf2b17138574a3f6ff2476468fafd7f957d2b68d6d98",{"version":"1ec27c4b695590464113276d174f873e260e468ef226b7dc18f9193875fa559d","affectsGlobalScope":true},"33da4ee2ab9fdd9ef8b3fc526d871ce02ae8c825283f5695e7cad507c087b97c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"71709584ed5ed7d236dc225441ec4634ffc6c718853e04b9c27b9ea121459044","6738101ae8e56cd3879ab3f99630ada7d78097fc9fd334df7e766216778ca219","b95f751a58d283cb5e32f2655361f6e2a27f0368f69edc463a3472aae21d1303","6d829824ead8999f87b6df21200df3c6150391b894b4e80662caa462bd48d073","afc559c1b93df37c25aef6b3dfa2d64325b0e112e887ee18bf7e6f4ec383fc90","ba601641fac98c229ccd4a303f747de376d761babb33229bb7153bed9356c9cc","495da6628b9474e31d0636d66c54448bb8d84dbce902e8f70539ef6a525a2d7b","629766229f541d92210f30a92b6038568ec165fab14b7ee53bdf13667da37ca3","204dbe6c72467fb14bbe8f06510b11fb541b6ce29580c6e10ebd3bdb2eb0c1f9","c1ea344dc311b2c539ed1e3b4e17e9f4853dc7f348366b51f1d8a09a40fb223f","ce013414484233b24f42c0fcfca48a60bb66ab4e13c82953662305e8f1ee4925","16d51f964ec125ad2024cf03f0af444b3bc3ec3614d9345cc54d09bab45c9a4c",{"version":"101eb8b4e972b9326f39591e2e40e967e3331e8d960f81248daeb266ea1affec","affectsGlobalScope":true},"84e3bbd6f80983d468260fdbfeeb431cc81f7ea98d284d836e4d168e36875e86","0b85cb069d0e427ba946e5eb2d86ef65ffd19867042810516d16919f6c1a5aec","15c88bfd1b8dc7231ff828ae8df5d955bae5ebca4cf2bcb417af5821e52299ae","eb96a2321f717bccc3e49e104e299152984b927ea4546b559ae631c06565819c","68c559681a043ca6d622debcce75c4d82446fec08e06bf1066f71d6c325f224e","bee89e1eb6425eb49894f3f25e4562dc2564e84e5aa7610b7e13d8ecddf8f5db","e98185f4249720ace1921d59c1ff4612fa5c633a183fc9bf28e2e7b8e3c7fd51","6168414aa12d33d0fcfac4f9870aa81ce27e136db6faf182001a5f3792e1d720","de18acda71730bac52f4b256ce7511bb56cc21f6f114c59c46782eff2f632857","7eb06594824ada538b1d8b48c3925a83e7db792f47a081a62cf3e5c4e23cf0ee","f5638f7c2f12a9a1a57b5c41b3c1ea7db3876c003bab68e6a57afd6bcc169af0","5006668996956580886022c05108e32c742823e1b5652aff7914917233731518","0c52f5366c9146ad79b546e70162c659972a2798522806e8283f3137feab3965",{"version":"677646e2620795c98a539fb12fb531f10331c217cef1492132b2518f894fa92d","affectsGlobalScope":true},"fc37aca06f6b8b296c42412a2e75ab53d30cd1fa8a340a3bb328a723fd678377","5f2c582b9ef260cb9559a64221b38606378c1fabe17694592cdfe5975a6d7efa","8baa5d0febc68db886c40bf341e5c90dc215a90cd64552e47e8184be6b7e3358","bc81aff061c53a7140270555f4b22da4ecfe8601e8027cf5aa175fbdc7927c31","65dfa4bc49ccd1355789abb6ae215b302a5b050fdee9651124fe7e826f33113c"],"root":[[63,67],[107,110]],"options":{"declaration":true,"esModuleInterop":true,"importHelpers":true,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","sourceMap":true,"strict":true,"target":9},"fileIdsList":[[157],[87,88,157],[96,157],[89,94,95,157],[89,94,157],[68,69,157],[70,157],[69,71,157],[81,86,99,100,101,103,104,157],[93,97,157],[98,157],[94,157],[93,98,102,157],[92,157],[93,157],[68,80,105,157],[72,75,76,79,157],[130,157,164],[130,157,164,167],[68,157],[130,157,164,169],[130,157,164,167,174,179],[127,130,157,164,169,175],[157,168,169,176,178],[157,185],[157,186],[157,189],[127,130,131,135,141,156,157,164,165,172,174,180,183,184,188],[111,157],[114,157],[115,120,148,157],[116,127,128,135,145,156,157],[116,117,127,135,157],[118,157],[119,120,128,136,157],[120,145,153,157],[121,123,127,135,157],[122,157],[123,124,157],[127,157],[125,127,157],[127,128,129,145,156,157],[127,128,129,142,145,148,157],[157,161],[123,127,130,135,145,156,157],[127,128,130,131,135,145,153,156,157],[130,132,145,153,156,157],[111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163],[127,133,157],[134,156,157],[123,127,135,145,157],[136,157],[137,157],[114,138,157],[139,155,157,161],[140,157],[141,157],[127,142,143,157],[142,144,157,159],[115,127,145,146,147,148,157],[115,145,147,157],[145,146,157],[148,157],[149,157],[145,157],[127,151,152,157],[151,152,157],[120,135,145,153,157],[154,157],[135,155,157],[115,130,141,156,157],[120,157],[145,157,158],[157,159],[157,160],[115,120,127,129,138,145,156,157,159,161],[145,157,162],[157,191],[157,192],[130,157,164,177],[68,78,157],[77,157],[82,157],[127,130,132,135,145,153,156,157,162,164],[127,145,157,164],[74,157],[73,157],[85,89,157],[85,157],[83,84,157],[85,89,90,91,157],[62,63,64,65,66,157],[62,64,65,66,106,157],[62,64,157],[62,64,66,106,157],[62,63,64,65,157],[62,64,106,157],[62,63,157],[62,157],[64],[63,64],[63]],"referencedMap":[[87,1],[88,1],[89,2],[94,1],[97,3],[96,4],[95,5],[70,6],[71,7],[69,1],[72,8],[105,9],[81,1],[98,10],[99,11],[100,1],[101,12],[103,13],[93,14],[102,15],[104,11],[106,16],[80,17],[77,1],[165,18],[166,1],[168,19],[76,20],[68,1],[170,21],[171,1],[167,18],[172,1],[173,1],[180,22],[181,1],[182,1],[176,23],[179,24],[183,1],[184,1],[185,1],[186,25],[187,26],[174,1],[188,27],[189,28],[177,1],[190,1],[111,29],[112,29],[114,30],[115,31],[116,32],[117,33],[118,34],[119,35],[120,36],[121,37],[122,38],[123,39],[124,39],[126,40],[125,41],[127,40],[128,42],[129,43],[113,44],[163,1],[130,45],[131,46],[132,47],[164,48],[133,49],[134,50],[135,51],[136,52],[137,53],[138,54],[139,55],[140,56],[141,57],[142,58],[143,58],[144,59],[145,60],[147,61],[146,62],[148,63],[149,64],[150,65],[151,66],[152,67],[153,68],[154,69],[155,70],[156,71],[157,72],[158,73],[159,74],[160,75],[161,76],[162,77],[192,78],[191,79],[169,1],[175,1],[193,1],[178,80],[79,81],[78,82],[83,83],[82,1],[194,84],[195,85],[73,20],[75,86],[74,87],[90,88],[84,89],[91,1],[85,90],[86,89],[92,91],[62,1],[59,1],[60,1],[10,1],[11,1],[15,1],[14,1],[2,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[22,1],[23,1],[3,1],[4,1],[27,1],[24,1],[25,1],[26,1],[28,1],[29,1],[30,1],[5,1],[31,1],[32,1],[33,1],[34,1],[6,1],[38,1],[35,1],[36,1],[37,1],[39,1],[7,1],[40,1],[45,1],[46,1],[41,1],[42,1],[43,1],[44,1],[8,1],[50,1],[47,1],[48,1],[49,1],[51,1],[9,1],[52,1],[61,1],[53,1],[54,1],[57,1],[55,1],[56,1],[1,1],[58,1],[13,1],[12,1],[67,92],[107,93],[65,94],[108,95],[66,96],[109,97],[64,98],[63,99],[110,1]],"exportedModulesMap":[[87,1],[88,1],[89,2],[94,1],[97,3],[96,4],[95,5],[70,6],[71,7],[69,1],[72,8],[105,9],[81,1],[98,10],[99,11],[100,1],[101,12],[103,13],[93,14],[102,15],[104,11],[106,16],[80,17],[77,1],[165,18],[166,1],[168,19],[76,20],[68,1],[170,21],[171,1],[167,18],[172,1],[173,1],[180,22],[181,1],[182,1],[176,23],[179,24],[183,1],[184,1],[185,1],[186,25],[187,26],[174,1],[188,27],[189,28],[177,1],[190,1],[111,29],[112,29],[114,30],[115,31],[116,32],[117,33],[118,34],[119,35],[120,36],[121,37],[122,38],[123,39],[124,39],[126,40],[125,41],[127,40],[128,42],[129,43],[113,44],[163,1],[130,45],[131,46],[132,47],[164,48],[133,49],[134,50],[135,51],[136,52],[137,53],[138,54],[139,55],[140,56],[141,57],[142,58],[143,58],[144,59],[145,60],[147,61],[146,62],[148,63],[149,64],[150,65],[151,66],[152,67],[153,68],[154,69],[155,70],[156,71],[157,72],[158,73],[159,74],[160,75],[161,76],[162,77],[192,78],[191,79],[169,1],[175,1],[193,1],[178,80],[79,81],[78,82],[83,83],[82,1],[194,84],[195,85],[73,20],[75,86],[74,87],[90,88],[84,89],[91,1],[85,90],[86,89],[92,91],[62,1],[59,1],[60,1],[10,1],[11,1],[15,1],[14,1],[2,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[22,1],[23,1],[3,1],[4,1],[27,1],[24,1],[25,1],[26,1],[28,1],[29,1],[30,1],[5,1],[31,1],[32,1],[33,1],[34,1],[6,1],[38,1],[35,1],[36,1],[37,1],[39,1],[7,1],[40,1],[45,1],[46,1],[41,1],[42,1],[43,1],[44,1],[8,1],[50,1],[47,1],[48,1],[49,1],[51,1],[9,1],[52,1],[61,1],[53,1],[54,1],[57,1],[55,1],[56,1],[1,1],[58,1],[13,1],[12,1],[67,92],[65,100],[66,101],[64,102],[110,1]],"semanticDiagnosticsPerFile":[87,88,89,94,97,96,95,70,71,69,72,105,81,98,99,100,101,103,93,102,104,106,80,77,165,166,168,76,68,170,171,167,172,173,180,181,182,176,179,183,184,185,186,187,174,188,189,177,190,111,112,114,115,116,117,118,119,120,121,122,123,124,126,125,127,128,129,113,163,130,131,132,164,133,134,135,136,137,138,139,140,141,142,143,144,145,147,146,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,192,191,169,175,193,178,79,78,83,82,194,195,73,75,74,90,84,91,85,86,92,62,59,60,10,11,15,14,2,16,17,18,19,20,21,22,23,3,4,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,50,47,48,49,51,9,52,61,53,54,57,55,56,1,58,13,12,67,107,65,108,66,109,64,63,110]},"version":"5.0.4"}