@tsed/event-emitter 8.10.0-rc.1 → 8.10.0-rc.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.
@@ -0,0 +1,76 @@
1
+ import { Inject as m, LOGGER as a, Constant as v, Module as h } from "@tsed/di";
2
+ var c = Object.defineProperty, d = Object.getOwnPropertyDescriptor, o = (e, t, n, i) => {
3
+ for (var r = i > 1 ? void 0 : i ? d(t, n) : t, l = e.length - 1, E; l >= 0; l--)
4
+ (E = e[l]) && (r = (i ? E(t, n, r) : E(r)) || r);
5
+ return i && r && c(t, n, r), r;
6
+ };
7
+ let s = class {
8
+ $onInit() {
9
+ this.loadEventEmitter && this.injector.getProviders().forEach((t) => this.bindEventListeners(t));
10
+ }
11
+ $onReady() {
12
+ this.loadEventEmitter ? (this.disableSummary || this.printEvents(), this.logger.info("EventEmitter listening...")) : this.logger.info("EventEmitter disabled...");
13
+ }
14
+ printEvents() {
15
+ const e = this.eventEmitter.eventNames().map((n) => {
16
+ const i = this.eventEmitter.listenerCount(n).toString();
17
+ return {
18
+ eventName: n,
19
+ listenerCount: i
20
+ };
21
+ });
22
+ this.logger.info("EventEmitter events mounted:");
23
+ const t = this.logger.drawTable(e, {
24
+ padding: 1,
25
+ header: {
26
+ eventName: "Event name",
27
+ listenerCount: "Number of listener"
28
+ }
29
+ });
30
+ this.logger.info(`
31
+ ` + t.trim());
32
+ }
33
+ bindEventListeners(e) {
34
+ this.bindOn(e), this.bindOnAny(e);
35
+ }
36
+ getListener(e, t) {
37
+ const n = this.injector.get(e.token);
38
+ return n[t].bind(n);
39
+ }
40
+ bindOn(e) {
41
+ const t = e.store.get("eventEmitter");
42
+ Object.entries((t == null ? void 0 : t.onEvent) || {}).forEach(([n, { event: i, options: r }]) => {
43
+ const l = this.getListener(e, n);
44
+ this.eventEmitter.on(i, l, r);
45
+ });
46
+ }
47
+ bindOnAny(e) {
48
+ const t = e.store.get("eventEmitter");
49
+ Object.keys((t == null ? void 0 : t.onAny) || {}).forEach((n) => {
50
+ const i = this.getListener(e, n);
51
+ this.eventEmitter.onAny(i);
52
+ });
53
+ }
54
+ };
55
+ o([
56
+ m(a)
57
+ ], s.prototype, "logger", 2);
58
+ o([
59
+ m()
60
+ ], s.prototype, "injector", 2);
61
+ o([
62
+ m()
63
+ ], s.prototype, "eventEmitter", 2);
64
+ o([
65
+ v("eventEmitter.disableSummary", !1)
66
+ ], s.prototype, "disableSummary", 2);
67
+ o([
68
+ v("eventEmitter.enabled", !1)
69
+ ], s.prototype, "loadEventEmitter", 2);
70
+ s = o([
71
+ h()
72
+ ], s);
73
+ export {
74
+ s as EventEmitterModule
75
+ };
76
+ //# sourceMappingURL=EventEmitterModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventEmitterModule.js","sources":["../../src/EventEmitterModule.ts"],"sourcesContent":["import {Constant, Inject, InjectorService, LOGGER, Module, Provider} from \"@tsed/di\";\nimport type {ListenerFn} from \"eventemitter2\";\n\nimport {EventEmitterStore} from \"./interfaces/EventEmitterStore.js\";\nimport {EventEmitterService} from \"./services/EventEmitterFactory.js\";\n\n@Module()\nexport class EventEmitterModule {\n @Inject(LOGGER)\n protected logger: LOGGER;\n\n @Inject()\n protected injector: InjectorService;\n\n @Inject()\n protected eventEmitter: EventEmitterService;\n\n @Constant(\"eventEmitter.disableSummary\", false)\n private disableSummary: boolean;\n\n @Constant(\"eventEmitter.enabled\", false)\n private loadEventEmitter: boolean;\n\n $onInit() {\n if (this.loadEventEmitter) {\n const providers = this.injector.getProviders();\n providers.forEach((provider) => this.bindEventListeners(provider));\n }\n }\n\n $onReady() {\n if (this.loadEventEmitter) {\n if (!this.disableSummary) {\n this.printEvents();\n }\n this.logger.info(\"EventEmitter listening...\");\n } else {\n this.logger.info(\"EventEmitter disabled...\");\n }\n }\n\n public printEvents() {\n const list = this.eventEmitter.eventNames().map((eventName) => {\n const listenerCount = this.eventEmitter.listenerCount(eventName).toString();\n\n return {\n eventName,\n listenerCount\n };\n });\n\n this.logger.info(\"EventEmitter events mounted:\");\n\n const str = this.logger.drawTable(list, {\n padding: 1,\n header: {\n eventName: \"Event name\",\n listenerCount: \"Number of listener\"\n }\n });\n\n this.logger.info(\"\\n\" + str.trim());\n }\n\n private bindEventListeners(provider: Provider<any>) {\n this.bindOn(provider);\n this.bindOnAny(provider);\n }\n\n private getListener(provider: Provider<any>, propertyKey: string) {\n const instance = this.injector.get(provider.token);\n return instance[propertyKey].bind(instance) as ListenerFn;\n }\n\n private bindOn(provider: Provider) {\n const store = provider.store.get<EventEmitterStore | undefined>(\"eventEmitter\");\n\n Object.entries(store?.onEvent || {}).forEach(([propertyKey, {event, options}]) => {\n const listenerFn = this.getListener(provider, propertyKey);\n\n this.eventEmitter.on(event, listenerFn, options);\n });\n }\n\n private bindOnAny(provider: Provider) {\n const store = provider.store.get<EventEmitterStore | undefined>(\"eventEmitter\");\n\n Object.keys(store?.onAny || {}).forEach((propertyKey) => {\n const listenerFn = this.getListener(provider, propertyKey);\n\n this.eventEmitter.onAny(listenerFn);\n });\n }\n}\n"],"names":["EventEmitterModule","provider","list","eventName","listenerCount","str","propertyKey","instance","store","event","options","listenerFn","__decorateClass","Inject","LOGGER","Constant","Module"],"mappings":";;;;;;AAOO,IAAMA,IAAN,MAAyB;AAAA,EAgB9B,UAAU;AACR,IAAI,KAAK,oBACW,KAAK,SAAS,aAAa,EACnC,QAAQ,CAACC,MAAa,KAAK,mBAAmBA,CAAQ,CAAC;AAAA,EACnE;AAAA,EAGF,WAAW;AACT,IAAI,KAAK,oBACF,KAAK,kBACR,KAAK,YAAY,GAEd,KAAA,OAAO,KAAK,2BAA2B,KAEvC,KAAA,OAAO,KAAK,0BAA0B;AAAA,EAC7C;AAAA,EAGK,cAAc;AACnB,UAAMC,IAAO,KAAK,aAAa,aAAa,IAAI,CAACC,MAAc;AAC7D,YAAMC,IAAgB,KAAK,aAAa,cAAcD,CAAS,EAAE,SAAS;AAEnE,aAAA;AAAA,QACL,WAAAA;AAAA,QACA,eAAAC;AAAA,MACF;AAAA,IAAA,CACD;AAEI,SAAA,OAAO,KAAK,8BAA8B;AAE/C,UAAMC,IAAM,KAAK,OAAO,UAAUH,GAAM;AAAA,MACtC,SAAS;AAAA,MACT,QAAQ;AAAA,QACN,WAAW;AAAA,QACX,eAAe;AAAA,MAAA;AAAA,IACjB,CACD;AAED,SAAK,OAAO,KAAK;AAAA,IAAOG,EAAI,MAAM;AAAA,EAAA;AAAA,EAG5B,mBAAmBJ,GAAyB;AAClD,SAAK,OAAOA,CAAQ,GACpB,KAAK,UAAUA,CAAQ;AAAA,EAAA;AAAA,EAGjB,YAAYA,GAAyBK,GAAqB;AAChE,UAAMC,IAAW,KAAK,SAAS,IAAIN,EAAS,KAAK;AACjD,WAAOM,EAASD,CAAW,EAAE,KAAKC,CAAQ;AAAA,EAAA;AAAA,EAGpC,OAAON,GAAoB;AACjC,UAAMO,IAAQP,EAAS,MAAM,IAAmC,cAAc;AAE9E,WAAO,SAAQO,KAAA,gBAAAA,EAAO,YAAW,CAAA,CAAE,EAAE,QAAQ,CAAC,CAACF,GAAa,EAAC,OAAAG,GAAO,SAAAC,EAAQ,CAAA,MAAM;AAChF,YAAMC,IAAa,KAAK,YAAYV,GAAUK,CAAW;AAEzD,WAAK,aAAa,GAAGG,GAAOE,GAAYD,CAAO;AAAA,IAAA,CAChD;AAAA,EAAA;AAAA,EAGK,UAAUT,GAAoB;AACpC,UAAMO,IAAQP,EAAS,MAAM,IAAmC,cAAc;AAEvE,WAAA,MAAKO,KAAA,gBAAAA,EAAO,UAAS,CAAA,CAAE,EAAE,QAAQ,CAACF,MAAgB;AACvD,YAAMK,IAAa,KAAK,YAAYV,GAAUK,CAAW;AAEpD,WAAA,aAAa,MAAMK,CAAU;AAAA,IAAA,CACnC;AAAA,EAAA;AAEL;AApFYC,EAAA;AAAA,EADTC,EAAOC,CAAM;AAAA,GADHd,EAED,WAAA,UAAA,CAAA;AAGAY,EAAA;AAAA,EADTC,EAAO;AAAA,GAJGb,EAKD,WAAA,YAAA,CAAA;AAGAY,EAAA;AAAA,EADTC,EAAO;AAAA,GAPGb,EAQD,WAAA,gBAAA,CAAA;AAGFY,EAAA;AAAA,EADPG,EAAS,+BAA+B,EAAK;AAAA,GAVnCf,EAWH,WAAA,kBAAA,CAAA;AAGAY,EAAA;AAAA,EADPG,EAAS,wBAAwB,EAAK;AAAA,GAb5Bf,EAcH,WAAA,oBAAA,CAAA;AAdGA,IAANY,EAAA;AAAA,EADNI,EAAO;AAAA,GACKhB,CAAA;"}
@@ -0,0 +1,15 @@
1
+ import { Store as n } from "@tsed/core";
2
+ function m() {
3
+ return (r, t) => {
4
+ const e = {
5
+ onAny: {
6
+ [t]: {}
7
+ }
8
+ };
9
+ n.from(r).merge("eventEmitter", e);
10
+ };
11
+ }
12
+ export {
13
+ m as OnAny
14
+ };
15
+ //# sourceMappingURL=onAny.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"onAny.js","sources":["../../../src/decorators/onAny.ts"],"sourcesContent":["import {Store} from \"@tsed/core\";\n\nimport {EventEmitterStore} from \"../interfaces/EventEmitterStore.js\";\n\nexport function OnAny(): MethodDecorator {\n return (target: any, propertyKey: string) => {\n const store: EventEmitterStore = {\n onAny: {\n [propertyKey]: {}\n }\n };\n\n Store.from(target).merge(\"eventEmitter\", store);\n };\n}\n"],"names":["OnAny","target","propertyKey","store","Store"],"mappings":";AAIO,SAASA,IAAyB;AAChC,SAAA,CAACC,GAAaC,MAAwB;AAC3C,UAAMC,IAA2B;AAAA,MAC/B,OAAO;AAAA,QACL,CAACD,CAAW,GAAG,CAAA;AAAA,MAAC;AAAA,IAEpB;AAEA,IAAAE,EAAM,KAAKH,CAAM,EAAE,MAAM,gBAAgBE,CAAK;AAAA,EAChD;AACF;"}
@@ -0,0 +1,15 @@
1
+ import { Store as m } from "@tsed/core";
2
+ function f(e, t) {
3
+ return (n, r) => {
4
+ const o = {
5
+ onEvent: {
6
+ [r]: { event: e, options: t }
7
+ }
8
+ };
9
+ m.from(n).merge("eventEmitter", o);
10
+ };
11
+ }
12
+ export {
13
+ f as OnEvent
14
+ };
15
+ //# sourceMappingURL=onEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"onEvent.js","sources":["../../../src/decorators/onEvent.ts"],"sourcesContent":["import {Store} from \"@tsed/core\";\nimport {event, eventNS, OnOptions} from \"eventemitter2\";\n\nimport {EventEmitterStore} from \"../interfaces/EventEmitterStore.js\";\n\nexport function OnEvent(event: event | eventNS, options?: boolean | OnOptions): MethodDecorator {\n return (target: any, propertyKey: string) => {\n const store: EventEmitterStore = {\n onEvent: {\n [propertyKey]: {event, options}\n }\n };\n\n Store.from(target).merge(\"eventEmitter\", store);\n };\n}\n"],"names":["OnEvent","event","options","target","propertyKey","store","Store"],"mappings":";AAKgB,SAAAA,EAAQC,GAAwBC,GAAgD;AACvF,SAAA,CAACC,GAAaC,MAAwB;AAC3C,UAAMC,IAA2B;AAAA,MAC/B,SAAS;AAAA,QACP,CAACD,CAAW,GAAG,EAAC,OAAAH,GAAO,SAAAC,EAAO;AAAA,MAAA;AAAA,IAElC;AAEA,IAAAI,EAAM,KAAKH,CAAM,EAAE,MAAM,gBAAgBE,CAAK;AAAA,EAChD;AACF;"}
@@ -0,0 +1,11 @@
1
+ import { OnAny as t } from "./decorators/onAny.js";
2
+ import { OnEvent as m } from "./decorators/onEvent.js";
3
+ import { EventEmitterModule as E } from "./EventEmitterModule.js";
4
+ import { EventEmitterService as p } from "./services/EventEmitterFactory.js";
5
+ export {
6
+ E as EventEmitterModule,
7
+ p as EventEmitterService,
8
+ t as OnAny,
9
+ m as OnEvent
10
+ };
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,15 @@
1
+ import { registerProvider as n, Configuration as i } from "@tsed/di";
2
+ import e from "/home/runner/work/tsed/tsed/node_modules/eventemitter2/lib/eventemitter2.js";
3
+ const E = e.EventEmitter2;
4
+ n({
5
+ token: e.EventEmitter2,
6
+ deps: [i],
7
+ useFactory(r) {
8
+ const t = r.get("eventEmitter", { enabled: !1 });
9
+ return t.enabled ? new e.EventEmitter2(t) : {};
10
+ }
11
+ });
12
+ export {
13
+ E as EventEmitterService
14
+ };
15
+ //# sourceMappingURL=EventEmitterFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventEmitterFactory.js","sources":["../../../src/services/EventEmitterFactory.ts"],"sourcesContent":["import {Configuration, registerProvider} from \"@tsed/di\";\nimport type {ConstructorOptions} from \"eventemitter2\";\nimport eventEmitter2 from \"eventemitter2\";\n\nexport const EventEmitterService = eventEmitter2.EventEmitter2;\nexport type EventEmitterService = eventEmitter2.EventEmitter2;\n\nregisterProvider({\n token: eventEmitter2.EventEmitter2,\n deps: [Configuration],\n useFactory(settings: Configuration) {\n const opts = settings.get<ConstructorOptions & {enabled: boolean}>(\"eventEmitter\", {enabled: false});\n return opts.enabled ? new eventEmitter2.EventEmitter2(opts) : {};\n }\n});\n"],"names":["EventEmitterService","eventEmitter2","registerProvider","Configuration","settings","opts"],"mappings":";;AAIO,MAAMA,IAAsBC,EAAc;AAGjDC,EAAiB;AAAA,EACf,OAAOD,EAAc;AAAA,EACrB,MAAM,CAACE,CAAa;AAAA,EACpB,WAAWC,GAAyB;AAClC,UAAMC,IAAOD,EAAS,IAA6C,gBAAgB,EAAC,SAAS,IAAM;AACnG,WAAOC,EAAK,UAAU,IAAIJ,EAAc,cAAcI,CAAI,IAAI,CAAC;AAAA,EAAA;AAEnE,CAAC;"}
package/package.json CHANGED
@@ -2,17 +2,17 @@
2
2
  "name": "@tsed/event-emitter",
3
3
  "description": "EventEmitter package for Ts.ED framework",
4
4
  "type": "module",
5
- "version": "8.10.0-rc.1",
5
+ "version": "8.10.0-rc.3",
6
6
  "source": "./src/index.ts",
7
7
  "main": "./lib/esm/index.js",
8
8
  "module": "./lib/esm/index.js",
9
9
  "typings": "./lib/types/index.d.ts",
10
- "browser": "./lib/browser/event-emitter.umd.cjs",
10
+ "browser": "./lib/browser/index.cjs",
11
11
  "exports": {
12
12
  ".": {
13
13
  "tsed-source": "./src/index.ts",
14
14
  "types": "./lib/types/index.d.ts",
15
- "browser": "./lib/browser/event-emitter.umd.cjs",
15
+ "browser": "./lib/browser/index.cjs",
16
16
  "import": "./lib/esm/index.js",
17
17
  "default": "./lib/esm/index.js"
18
18
  }
@@ -29,11 +29,11 @@
29
29
  "tslib": "2.7.0"
30
30
  },
31
31
  "devDependencies": {
32
- "@tsed/barrels": "8.10.0-rc.1",
33
- "@tsed/core": "8.10.0-rc.1",
34
- "@tsed/di": "8.10.0-rc.1",
35
- "@tsed/platform-http": "8.10.0-rc.1",
36
- "@tsed/typescript": "8.10.0-rc.1",
32
+ "@tsed/barrels": "8.10.0-rc.3",
33
+ "@tsed/core": "8.10.0-rc.3",
34
+ "@tsed/di": "8.10.0-rc.3",
35
+ "@tsed/platform-http": "8.10.0-rc.3",
36
+ "@tsed/typescript": "8.10.0-rc.3",
37
37
  "eslint": "9.12.0",
38
38
  "eventemitter2": "^6.4.9",
39
39
  "typescript": "5.4.5",
package/vite.config.mts CHANGED
@@ -1,19 +1,45 @@
1
1
  import {defineConfig} from "vite";
2
2
  import {join} from "node:path";
3
+ import {extname, relative} from "path";
4
+ import {fileURLToPath} from "node:url";
5
+ import {globbySync} from "globby";
3
6
 
4
7
  // https://vitejs.dev/config/
5
8
  export default defineConfig({
6
9
  plugins: [],
7
10
  build: {
11
+ assetsInlineLimit: 0,
12
+ sourcemap: true,
8
13
  outDir: "lib/browser",
9
14
  lib: {
10
15
  entry: join(import.meta.dirname, "src/index.ts"),
11
- formats: ["umd"],
12
- name: "@tsed/event-emitter",
13
- fileName: "event-emitter"
16
+ formats: ["es"]
14
17
  },
15
18
  rollupOptions: {
16
- external: /node_modules\/(.*)/
19
+ external: [/node_modules\/(.*)/, /^@tsed\//],
20
+ input: Object.fromEntries(
21
+ globbySync("src/**/*.ts", {
22
+ ignore: [
23
+ "**/*.spec.{ts,tsx}",
24
+ "**/*.stories.{ts,tsx}",
25
+ "**/__mocks__/**",
26
+ "**/__mock__/**",
27
+ "**/interfaces/**"
28
+ ]
29
+ }).map((file) => [
30
+ // The name of the entry point
31
+ // lib/nested/foo.ts becomes nested/foo
32
+ relative("src", file.slice(0, file.length - extname(file).length)),
33
+ // The absolute path to the entry file
34
+ // lib/nested/foo.ts becomes /project/lib/nested/foo.ts
35
+ fileURLToPath(new URL(file, import.meta.url))
36
+ ])
37
+ ),
38
+ output: {
39
+ assetFileNames: "assets/[name][extname]",
40
+ chunkFileNames: "chunks/[name].js",
41
+ entryFileNames: "[name].js"
42
+ }
17
43
  }
18
44
  }
19
45
  });
@@ -1,23 +0,0 @@
1
- (function(J,be){typeof exports=="object"&&typeof module<"u"?be(exports,require("\0/home/runner/work/tsed/tsed/node_modules/reflect-metadata/Reflect.js?commonjs-external"),require("/home/runner/work/tsed/tsed/node_modules/eventemitter2/lib/eventemitter2.js")):typeof define=="function"&&define.amd?define(["exports","\0/home/runner/work/tsed/tsed/node_modules/reflect-metadata/Reflect.js?commonjs-external","/home/runner/work/tsed/tsed/node_modules/eventemitter2/lib/eventemitter2.js"],be):(J=typeof globalThis<"u"?globalThis:J||self,be(J["@tsed/event-emitter"]={},J.require$$0,J.eventEmitter2))})(this,function(J,be,Sr){"use strict";var Tr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},we={exports:{}},un=we.exports,nn;function fn(){return nn||(nn=1,function(ft,I){(function(a,$){$(I)})(un,function(a){var $=r=>{throw TypeError(r)},U=(r,o,i)=>o.has(r)||$("Cannot "+i),A=(r,o,i)=>(U(r,o,"read from private field"),i?i.call(r):o.get(r)),Q=(r,o,i)=>o.has(r)?$("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(r):o.set(r,i),Y=(r,o,i,h)=>(U(r,o,"write to private field"),o.set(r,i),i),ot,St,tt,lt,Z=(r=>(r.PARAM="parameter",r.PARAM_CTOR="parameter.constructor",r.PARAM_STC="parameter.static",r.PROP="property",r.PROP_STC="property.static",r.METHOD="method",r.METHOD_STC="method.static",r.CLASS="class",r))(Z||{});function q(r){return r.prototype?r:r.constructor}function x(r){return q(r)}function mt(r){const[o,i,h]=r,g=E=>o!==x(o)?E:`${E}.static`;return typeof h=="number"?i?g("parameter"):"parameter.constructor":h&&h.value?g("method"):i&&h===void 0||h?g("property"):Z.CLASS}function Ct(r){return r===Date||r instanceof Date&&!isNaN(+r)}function Ot(r){return typeof r=="function"}function bt(r){return r==null}function Lt(r){return typeof r=="boolean"||r instanceof Boolean||r===Boolean}function Ft(r){return typeof r=="boolean"||r instanceof Boolean||r===Boolean}function te(r){return typeof r=="number"}function jt(r){return typeof r=="number"||r instanceof Number||r===Number}function Bt(r){return typeof r=="string"}function ee(r){return typeof r=="string"||r instanceof String||r===String}function He(r){return ee(r)||jt(r)||Ft(r)}function X(r){return Bt(r)||te(r)||Lt(r)}function Vt(r){return[String,Number,Boolean].includes(r)}function ze(r){return r instanceof RegExp}function j(r){return typeof r=="symbol"}function qe(r){return typeof r=="symbol"||r instanceof Symbol||r===Symbol}const wt=r=>bt(r)||X(r)||j(r)||Ot(r),Et=(r,o=new WeakMap)=>{if(wt(r))return r;const i=o.get(r);if(i)return i;if(ArrayBuffer.isView(r))return Buffer.isBuffer(r)?Buffer.from(r):new(x(r))(r.buffer.slice(0),r.byteOffset,r.byteLength);if(Ct(r))return new Date(r);if(ze(r))return new RegExp(r);if(Array.isArray(r)){const g=[];return o.set(r,g),r.forEach((E,k)=>g[k]=Et(E,o)),g}if(r instanceof Map){const g=new Map;return o.set(r,g),r.forEach((E,k)=>g.set(Et(k,o),Et(E,o))),g}if(r instanceof Set){const g=new Set;return o.set(r,g),r.forEach(E=>g.add(Et(E,o))),g}const h=Object.create(Reflect.getPrototypeOf(r));return o.set(r,h),Reflect.ownKeys(r).forEach(g=>{const E=Object.getOwnPropertyDescriptor(r,g);E&&(Ot(E.value)?Object.defineProperty(h,g,E):Object.defineProperty(h,g,{...E,value:Et(E.value,o)}))}),h};function Je(r){return r?x(r)!==Object?Object.create(r):{}:{}}function re(r){return["__proto__","constructor","prototype"].includes(r)}function Pe(r){return Object.keys(r).filter(o=>!re(o))}function Qe(r){return(o,i,h)=>{const g=o.findIndex(E=>r(E,i));return g===-1?[...o,i]:(o[g]=Ut(o[g],i,h),o)}}const Kt=Qe((r,o)=>r===o);function kr({reducers:r,parentKey:o}){return r?o&&r[o]?r[o]:r.default||Kt:Kt}function Ar(r,o){return X(r)||j(r)||Ot(r)||o===void 0}function Ye(r,o){return r==null||r===""&&o!==""}function Ut(r,o,i={}){if(Ye(o,r))return r;if(Ar(o,r))return o;if(Array.isArray(r)){const g=kr(i);return[].concat(o).reduce((E,k)=>g(E,k,i),[...r])}const h=Je(r);return[...Pe(r),...Pe(o)].reduce((g,E)=>{var k;const D=r&&r[E],K=Ut(D,o&&o[E],{...i,parentKey:E});return i.cleanUndefinedProps&&K===void 0||(g[E]=((k=i.alter)==null?void 0:k.call(i,E,K))??K),g},h)}function et(r,o){return Reflect.getOwnPropertyDescriptor(r&&r.prototype||r,o)}function Cr(r,o){var i;return(i=et(r,o))==null?void 0:i.value}function ct(r){return typeof r=="function"?r.name:r.constructor.name}const Ze=r=>r.toString().replace("Symbol(","").replace(")","");function ht(r){switch(typeof r){default:return""+r;case"symbol":return Ze(r);case"function":return ct(r)}}var Re=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof Tr<"u"?Tr:typeof self<"u"?self:{},Xe={};/*! *****************************************************************************
2
- Copyright (C) Microsoft. All rights reserved.
3
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
- this file except in compliance with the License. You may obtain a copy of the
5
- License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10
- MERCHANTABLITY OR NON-INFRINGEMENT.
11
-
12
- See the Apache Version 2.0 License for specific language governing permissions
13
- and limitations under the License.
14
- ***************************************************************************** */var Me;function jr(){if(Me)return Xe;Me=1;var r;return function(o){(function(i){var h=typeof globalThis=="object"?globalThis:typeof Re=="object"?Re:typeof self=="object"?self:typeof this=="object"?this:K(),g=E(o);typeof h.Reflect<"u"&&(g=E(h.Reflect,g)),i(g,h),typeof h.Reflect>"u"&&(h.Reflect=o);function E(st,yt){return function(gt,Dt){Object.defineProperty(st,gt,{configurable:!0,writable:!0,value:Dt}),yt&&yt(gt,Dt)}}function k(){try{return Function("return this;")()}catch{}}function D(){try{return(0,eval)("(function() { return this; })()")}catch{}}function K(){return k()||D()}})(function(i,h){var g=Object.prototype.hasOwnProperty,E=typeof Symbol=="function",k=E&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",D=E&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",K=typeof Object.create=="function",st={__proto__:[]}instanceof Array,yt=!K&&!st,gt={create:K?function(){return ut(Object.create(null))}:st?function(){return ut({__proto__:null})}:function(){return ut({})},has:yt?function(u,f){return g.call(u,f)}:function(u,f){return f in u},get:yt?function(u,f){return g.call(u,f)?u[f]:void 0}:function(u,f){return u[f]}},Dt=Object.getPrototypeOf(Function),Yt=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:N(),Nt=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:at(),de=typeof WeakMap=="function"?WeakMap:Mt(),xt=E?Symbol.for("@reflect-metadata:registry"):void 0,ye=b(),dr=m(ye);function Fe(u,f,p,v){if(S(p)){if(!Pr(u))throw new TypeError;if(!Rr(f))throw new TypeError;return Xr(u,f)}else{if(!Pr(u))throw new TypeError;if(!G(f))throw new TypeError;if(!G(v)&&!S(v)&&!$t(v))throw new TypeError;return $t(v)&&(v=void 0),p=it(p),vr(u,f,p,v)}}i("decorate",Fe);function Be(u,f){function p(v,w){if(!G(v))throw new TypeError;if(!S(w)&&!Mr(w))throw new TypeError;Ge(u,f,v,w)}return p}i("metadata",Be);function Ve(u,f,p,v){if(!G(p))throw new TypeError;return S(v)||(v=it(v)),Ge(u,f,p,v)}i("defineMetadata",Ve);function yr(u,f,p){if(!G(f))throw new TypeError;return S(p)||(p=it(p)),Ke(u,f,p)}i("hasMetadata",yr);function Jr(u,f,p){if(!G(f))throw new TypeError;return S(p)||(p=it(p)),Ue(u,f,p)}i("hasOwnMetadata",Jr);function gr(u,f,p){if(!G(f))throw new TypeError;return S(p)||(p=it(p)),ve(u,f,p)}i("getMetadata",gr);function Qr(u,f,p){if(!G(f))throw new TypeError;return S(p)||(p=it(p)),We(u,f,p)}i("getOwnMetadata",Qr);function Yr(u,f){if(!G(u))throw new TypeError;return S(f)||(f=it(f)),mr(u,f)}i("getMetadataKeys",Yr);function ge(u,f){if(!G(u))throw new TypeError;return S(f)||(f=it(f)),Or(u,f)}i("getOwnMetadataKeys",ge);function Zr(u,f,p){if(!G(f))throw new TypeError;if(S(p)||(p=it(p)),!G(f))throw new TypeError;S(p)||(p=it(p));var v=L(f,p,!1);return S(v)?!1:v.OrdinaryDeleteMetadata(u,f,p)}i("deleteMetadata",Zr);function Xr(u,f){for(var p=u.length-1;p>=0;--p){var v=u[p],w=v(f);if(!S(w)&&!$t(w)){if(!Rr(w))throw new TypeError;f=w}}return f}function vr(u,f,p,v){for(var w=u.length-1;w>=0;--w){var _=u[w],M=_(f,p,v);if(!S(M)&&!$t(M)){if(!G(M))throw new TypeError;v=M}}return v}function Ke(u,f,p){var v=Ue(u,f,p);if(v)return!0;var w=c(f);return $t(w)?!1:Ke(u,w,p)}function Ue(u,f,p){var v=L(f,p,!1);return S(v)?!1:me(v.OrdinaryHasOwnMetadata(u,f,p))}function ve(u,f,p){var v=Ue(u,f,p);if(v)return We(u,f,p);var w=c(f);if(!$t(w))return ve(u,w,p)}function We(u,f,p){var v=L(f,p,!1);if(!S(v))return v.OrdinaryGetOwnMetadata(u,f,p)}function Ge(u,f,p,v){var w=L(p,v,!0);w.OrdinaryDefineOwnMetadata(u,f,p,v)}function mr(u,f){var p=Or(u,f),v=c(u);if(v===null)return p;var w=mr(v,f);if(w.length<=0)return p;if(p.length<=0)return w;for(var _=new Nt,M=[],R=0,d=p;R<d.length;R++){var y=d[R],O=_.has(y);O||(_.add(y),M.push(y))}for(var P=0,C=w;P<C.length;P++){var y=C[P],O=_.has(y);O||(_.add(y),M.push(y))}return M}function Or(u,f){var p=L(u,f,!1);return p?p.OrdinaryOwnMetadataKeys(u,f):[]}function br(u){if(u===null)return 1;switch(typeof u){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return u===null?1:6;default:return 6}}function S(u){return u===void 0}function $t(u){return u===null}function wr(u){return typeof u=="symbol"}function G(u){return typeof u=="object"?u!==null:typeof u=="function"}function tn(u,f){switch(br(u)){case 0:return u;case 1:return u;case 2:return u;case 3:return u;case 4:return u;case 5:return u}var p="string",v=_r(u,k);if(v!==void 0){var w=v.call(u,p);if(G(w))throw new TypeError;return w}return en(u)}function en(u,f){var p,v;{var w=u.toString;if(Zt(w)){var v=w.call(u);if(!G(v))return v}var p=u.valueOf;if(Zt(p)){var v=p.call(u);if(!G(v))return v}}throw new TypeError}function me(u){return!!u}function Er(u){return""+u}function it(u){var f=tn(u);return wr(f)?f:Er(f)}function Pr(u){return Array.isArray?Array.isArray(u):u instanceof Object?u instanceof Array:Object.prototype.toString.call(u)==="[object Array]"}function Zt(u){return typeof u=="function"}function Rr(u){return typeof u=="function"}function Mr(u){switch(br(u)){case 3:return!0;case 4:return!0;default:return!1}}function Oe(u,f){return u===f||u!==u&&f!==f}function _r(u,f){var p=u[f];if(p!=null){if(!Zt(p))throw new TypeError;return p}}function e(u){var f=_r(u,D);if(!Zt(f))throw new TypeError;var p=f.call(u);if(!G(p))throw new TypeError;return p}function t(u){return u.value}function n(u){var f=u.next();return f.done?!1:f}function s(u){var f=u.return;f&&f.call(u)}function c(u){var f=Object.getPrototypeOf(u);if(typeof u!="function"||u===Dt||f!==Dt)return f;var p=u.prototype,v=p&&Object.getPrototypeOf(p);if(v==null||v===Object.prototype)return f;var w=v.constructor;return typeof w!="function"||w===u?f:w}function l(){var u;!S(xt)&&typeof h.Reflect<"u"&&!(xt in h.Reflect)&&typeof h.Reflect.defineMetadata=="function"&&(u=T(h.Reflect));var f,p,v,w=new de,_={registerProvider:M,getProvider:d,setProvider:O};return _;function M(P){if(!Object.isExtensible(_))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case u===P:break;case S(f):f=P;break;case f===P:break;case S(p):p=P;break;case p===P:break;default:v===void 0&&(v=new Nt),v.add(P);break}}function R(P,C){if(!S(f)){if(f.isProviderFor(P,C))return f;if(!S(p)){if(p.isProviderFor(P,C))return f;if(!S(v))for(var B=e(v);;){var z=n(B);if(!z)return;var vt=t(z);if(vt.isProviderFor(P,C))return s(B),vt}}}if(!S(u)&&u.isProviderFor(P,C))return u}function d(P,C){var B=w.get(P),z;return S(B)||(z=B.get(C)),S(z)&&(z=R(P,C),S(z)||(S(B)&&(B=new Yt,w.set(P,B)),B.set(C,z))),z}function y(P){if(S(P))throw new TypeError;return f===P||p===P||!S(v)&&v.has(P)}function O(P,C,B){if(!y(B))throw new Error("Metadata provider not registered.");var z=d(P,C);if(z!==B){if(!S(z))return!1;var vt=w.get(P);S(vt)&&(vt=new Yt,w.set(P,vt)),vt.set(C,B)}return!0}}function b(){var u;return!S(xt)&&G(h.Reflect)&&Object.isExtensible(h.Reflect)&&(u=h.Reflect[xt]),S(u)&&(u=l()),!S(xt)&&G(h.Reflect)&&Object.isExtensible(h.Reflect)&&Object.defineProperty(h.Reflect,xt,{enumerable:!1,configurable:!1,writable:!1,value:u}),u}function m(u){var f=new de,p={isProviderFor:function(y,O){var P=f.get(y);return S(P)?!1:P.has(O)},OrdinaryDefineOwnMetadata:M,OrdinaryHasOwnMetadata:w,OrdinaryGetOwnMetadata:_,OrdinaryOwnMetadataKeys:R,OrdinaryDeleteMetadata:d};return ye.registerProvider(p),p;function v(y,O,P){var C=f.get(y),B=!1;if(S(C)){if(!P)return;C=new Yt,f.set(y,C),B=!0}var z=C.get(O);if(S(z)){if(!P)return;if(z=new Yt,C.set(O,z),!u.setProvider(y,O,p))throw C.delete(O),B&&f.delete(y),new Error("Wrong provider for target.")}return z}function w(y,O,P){var C=v(O,P,!1);return S(C)?!1:me(C.has(y))}function _(y,O,P){var C=v(O,P,!1);if(!S(C))return C.get(y)}function M(y,O,P,C){var B=v(P,C,!0);B.set(y,O)}function R(y,O){var P=[],C=v(y,O,!1);if(S(C))return P;for(var B=C.keys(),z=e(B),vt=0;;){var an=n(z);if(!an)return P.length=vt,P;var mn=t(an);try{P[vt]=mn}catch(On){try{s(z)}finally{throw On}}vt++}}function d(y,O,P){var C=v(O,P,!1);if(S(C)||!C.delete(y))return!1;if(C.size===0){var B=f.get(O);S(B)||(B.delete(P),B.size===0&&f.delete(B))}return!0}}function T(u){var f=u.defineMetadata,p=u.hasOwnMetadata,v=u.getOwnMetadata,w=u.getOwnMetadataKeys,_=u.deleteMetadata,M=new de,R={isProviderFor:function(d,y){var O=M.get(d);return!S(O)&&O.has(y)?!0:w(d,y).length?(S(O)&&(O=new Nt,M.set(d,O)),O.add(y),!0):!1},OrdinaryDefineOwnMetadata:f,OrdinaryHasOwnMetadata:p,OrdinaryGetOwnMetadata:v,OrdinaryOwnMetadataKeys:w,OrdinaryDeleteMetadata:_};return R}function L(u,f,p){var v=ye.getProvider(u,f);if(!S(v))return v;if(p){if(ye.setProvider(u,f,dr))return dr;throw new Error("Illegal state.")}}function N(){var u={},f=[],p=function(){function R(d,y,O){this._index=0,this._keys=d,this._values=y,this._selector=O}return R.prototype["@@iterator"]=function(){return this},R.prototype[D]=function(){return this},R.prototype.next=function(){var d=this._index;if(d>=0&&d<this._keys.length){var y=this._selector(this._keys[d],this._values[d]);return d+1>=this._keys.length?(this._index=-1,this._keys=f,this._values=f):this._index++,{value:y,done:!1}}return{value:void 0,done:!0}},R.prototype.throw=function(d){throw this._index>=0&&(this._index=-1,this._keys=f,this._values=f),d},R.prototype.return=function(d){return this._index>=0&&(this._index=-1,this._keys=f,this._values=f),{value:d,done:!0}},R}(),v=function(){function R(){this._keys=[],this._values=[],this._cacheKey=u,this._cacheIndex=-2}return Object.defineProperty(R.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),R.prototype.has=function(d){return this._find(d,!1)>=0},R.prototype.get=function(d){var y=this._find(d,!1);return y>=0?this._values[y]:void 0},R.prototype.set=function(d,y){var O=this._find(d,!0);return this._values[O]=y,this},R.prototype.delete=function(d){var y=this._find(d,!1);if(y>=0){for(var O=this._keys.length,P=y+1;P<O;P++)this._keys[P-1]=this._keys[P],this._values[P-1]=this._values[P];return this._keys.length--,this._values.length--,Oe(d,this._cacheKey)&&(this._cacheKey=u,this._cacheIndex=-2),!0}return!1},R.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=u,this._cacheIndex=-2},R.prototype.keys=function(){return new p(this._keys,this._values,w)},R.prototype.values=function(){return new p(this._keys,this._values,_)},R.prototype.entries=function(){return new p(this._keys,this._values,M)},R.prototype["@@iterator"]=function(){return this.entries()},R.prototype[D]=function(){return this.entries()},R.prototype._find=function(d,y){if(!Oe(this._cacheKey,d)){this._cacheIndex=-1;for(var O=0;O<this._keys.length;O++)if(Oe(this._keys[O],d)){this._cacheIndex=O;break}}return this._cacheIndex<0&&y&&(this._cacheIndex=this._keys.length,this._keys.push(d),this._values.push(void 0)),this._cacheIndex},R}();return v;function w(R,d){return R}function _(R,d){return d}function M(R,d){return[R,d]}}function at(){var u=function(){function f(){this._map=new Yt}return Object.defineProperty(f.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),f.prototype.has=function(p){return this._map.has(p)},f.prototype.add=function(p){return this._map.set(p,p),this},f.prototype.delete=function(p){return this._map.delete(p)},f.prototype.clear=function(){this._map.clear()},f.prototype.keys=function(){return this._map.keys()},f.prototype.values=function(){return this._map.keys()},f.prototype.entries=function(){return this._map.entries()},f.prototype["@@iterator"]=function(){return this.keys()},f.prototype[D]=function(){return this.keys()},f}();return u}function Mt(){var u=16,f=gt.create(),p=v();return function(){function d(){this._key=v()}return d.prototype.has=function(y){var O=w(y,!1);return O!==void 0?gt.has(O,this._key):!1},d.prototype.get=function(y){var O=w(y,!1);return O!==void 0?gt.get(O,this._key):void 0},d.prototype.set=function(y,O){var P=w(y,!0);return P[this._key]=O,this},d.prototype.delete=function(y){var O=w(y,!1);return O!==void 0?delete O[this._key]:!1},d.prototype.clear=function(){this._key=v()},d}();function v(){var d;do d="@@WeakMap@@"+R();while(gt.has(f,d));return f[d]=!0,d}function w(d,y){if(!g.call(d,p)){if(!y)return;Object.defineProperty(d,p,{value:gt.create()})}return d[p]}function _(d,y){for(var O=0;O<y;++O)d[O]=Math.random()*255|0;return d}function M(d){if(typeof Uint8Array=="function"){var y=new Uint8Array(d);return typeof crypto<"u"?crypto.getRandomValues(y):typeof msCrypto<"u"?msCrypto.getRandomValues(y):_(y,d),y}return _(new Array(d),d)}function R(){var d=M(u);d[6]=d[6]&79|64,d[8]=d[8]&191|128;for(var y="",O=0;O<u;++O){var P=d[O];(O===4||O===6||O===8)&&(y+="-"),P<16&&(y+="0"),y+=P.toString(16).toLowerCase()}return y}}function ut(u){return u.__=void 0,delete u.__,u}})}(r||(r={})),Xe}jr();const _e="design:paramtypes",tr="design:type",Tt="design:returntype",Wt=new Map,er=class{static get(o,i,h){return Reflect.getMetadata(o,x(i),h)}static getOwn(o,i,h){return Reflect.getOwnMetadata(o,x(i),h)}static getType(o,i){return Reflect.getMetadata(tr,o,i)}static getOwnType(o,i){return Reflect.getMetadata(tr,o,i)}static getReturnType(o,i){return Reflect.getMetadata(Tt,o,i)}static getOwnReturnType(o,i){return Reflect.getOwnMetadata(Tt,o,i)}static has(o,i,h){try{return Reflect.hasMetadata(o,x(i),h)}catch{}return!1}static hasOwn(o,i,h){return Reflect.hasOwnMetadata(o,x(i),h)}static delete(o,i,h){return Reflect.deleteMetadata(o,x(i),h)}static setParamTypes(o,i,h){return this.set(_e,h,o.prototype,i)}static set(o,i,h,g){const E=Wt.has(o)?Wt.get(o)||[]:[],k=x(h);E.indexOf(k)===-1&&(E.push(k),Wt.set(o,E)),Reflect.defineMetadata(o,i,x(h),g)}static getParamTypes(o,i){return Reflect.getMetadata(_e,o,i)||[]}static getOwnParamTypes(o,i){return Reflect.getOwnMetadata(_e,o,i)||[]}};er.getTargetsFromPropertyKey=r=>Wt.has(r)?Wt.get(r)||[]:[];let rr=er;const nr="tsed:class:store",ne="tsed:method:store",Gt="tsed:property:store",Se="tsed:param:store",Te=new Map;function oe(r,...o){if(j(o[0]))return Te.has(o[0])||Te.set(o[0],new F),Te.get(o[0]);{const i=rr;return i.hasOwn(r,...o)||i.set(r,new F,...o),i.getOwn(r,...o)}}function Ir(r){const[o,i,h]=r;switch(mt(r)){case Z.PARAM_CTOR:case Z.PARAM_STC:case Z.PARAM:const g=oe(Se,o,i);return g.has(""+h)||g.set(""+h,new F),g.get(""+h);case Z.PROP:case Z.PROP_STC:return oe(Gt,o,i);case Z.METHOD:case Z.METHOD_STC:return oe(ne,o,i);case Z.CLASS:return oe(nr,o)}}class F{constructor(){this._entries=new Map}static from(...o){return Ir(o)}static fromMethod(o,i){return F.from(o,i,et(o,i))}static mergeStoreFrom(o,i,...h){const g=F.from(o,...h);return F.from(i,...h)._entries.forEach((E,k)=>{g.merge(k,E)}),g}static mergeStoreMethodFrom(o,i,h){return this.mergeStoreFrom(o,i,h,et(o,h))}get(o,i){return this._entries.get(ht(o))||i}has(o){return this._entries.has(ht(o))}set(o,i){return this._entries.set(ht(o),i),this}delete(o){return this._entries.delete(ht(o))}merge(o,i,h=!1){let g=this.get(o);return g&&(i=Et(i),g=Et(g),i=h?Ut(i,g):Ut(g,i)),this.set(o,i),this}toJson(){return[...this._entries.entries()].reduce((o,[i,h])=>({...o,[i]:h}),{})}}function ke(r){return(...o)=>{const i=F.from(...o),h=r(i,o);return typeof h=="function"&&h(...o),o[2]}}function se(r,o){return ke(i=>{i.merge(r,o)})}function Ht(r,o){return ke(i=>{i.set(r,o)})}class V extends Error{constructor(o,i){super(V.buildMessage(o,i))}static buildMessage(o,i){const[h,g,E]=i,k=mt(i),D=k.split("/")[0],K=D==="parameter"?".["+E+"]":"",st=g?"."+g:D==="parameter"?".constructor":"",yt=ht(x(h))+st+K;return`${o.name} cannot be used as ${k} decorator on ${yt}`}}var Pt=(r=>(r.PROD="production",r.DEV="development",r.TEST="test",r))(Pt||{});const Ae=Pt,ie=Function;Tr.Type=ie;function ae(r){return r&&Object.getPrototypeOf(r)}function Ce(r){return ae(r)}function kt(r){const o=[];let i=x(r);for(;i&&ht(i)!=="";)o.unshift(i),i=Ce(i);return o}function zt(r){return typeof r=="object"}function Rt(r){return!!r&&typeof r.lift=="function"&&typeof r.subscribe=="function"}function je(r){return r===Promise||r instanceof Promise||!!r&&typeof r.subscribe!="function"&&typeof r.then=="function"}function ce(r){return r!==null&&typeof r=="object"&&typeof r.pipe=="function"}function or(r){return zt(r)&&"data"in r&&"headers"in r&&"status"in r&&"statusText"in r}var sr=(r=>(r.PENDING="PENDING",r.CANCELED="CANCELED",r.RESOLVED="RESOLVED",r.REJECTED="REJECTED",r))(sr||{}),ue=(r=>(r.STREAM="STREAM",r.BUFFER="BUFFER",r.DATA="DATA",r))(ue||{});class fe{constructor({hasNextFunction:o=!1}={}){Q(this,ot),Q(this,St),Q(this,tt),Q(this,lt),this.status="PENDING",Y(this,tt,!1),Y(this,tt,o),Y(this,lt,new Promise((i,h)=>{Y(this,ot,i),Y(this,St,h)}))}isDone(){return this.status!=="PENDING"}get next(){return Y(this,tt,!0),o=>{if(!this.isDone())return o?this.reject(o):this.resolve({type:"DATA"})}}call(o){if(this.isDone())return Promise.resolve(this);try{this.handle(o())}catch(i){this.reject(i)}return A(this,lt)}reject(o){this.isDone()||(this.done("REJECTED"),A(this,St).call(this,o))}resolve(o={}){this.isDone()||(this.done("RESOLVED"),A(this,ot).call(this,{...o,state:"RESOLVED"}))}destroy(){}cancel(){if(!this.isDone())return this.done("CANCELED"),A(this,ot).call(this,{state:"CANCELED"})}done(o){this.destroy(),this.status=o}handle(o,i={}){if(!this.isDone()){if(o){if(this.isCanceledResponse(o))return this.cancel();if(Rt(o)&&(o=o.toPromise()),or(o))return this.handle(o.data,{...i,status:o.status,headers:o.headers});if(ce(o))return this.resolve({...i,type:"STREAM",data:o});if(ce(o)||Buffer.isBuffer(o))return this.resolve({...i,type:"BUFFER",data:o});if(je(o))return o.then(h=>this.handle(h,i)).catch(h=>h.response&&or(h.response)?this.handle(h.response):this.reject(h))}if(!A(this,tt))return this.resolve({...i,data:o,type:"DATA"})}}isCanceledResponse(o){return o==="CANCELED"}}ot=new WeakMap,St=new WeakMap,tt=new WeakMap,lt=new WeakMap;function Dr(r){try{r()}catch(o){return o}}async function W(r){try{await r()}catch(o){return o}}function Nr(r,o=[]){return Object.entries(r).reduce((i,[h,g])=>(re(h)||o.includes(h)||g===void 0||(i[h]=g),i),{})}function qt(r){return typeof r=="function"?r:r.constructor}function Ie(r){return qt(r)}function It(r){return x(r)===r?r.prototype:r}function rt(r){const o=new Map;return r=x(r),kt(r).forEach(i=>{Reflect.ownKeys(It(i)).forEach(h=>{var g;j(h)||h==="constructor"||(g=Object.getOwnPropertyDescriptor(It(i),h))!=null&&g.get||o.set(h,{target:i,propertyKey:h})})}),Array.from(o.values())}function nt(r,o){rt(r).forEach(({target:i,propertyKey:h})=>{const g=It(r);i!==x(r)&&(Object.defineProperty(g,h,{writable:!0,configurable:!0,value(...D){return It(i)[h].apply(this,D)}}),F.mergeStoreMethodFrom(r,i,h));let E=et(r,h);const k=o(g,h,E)||E;k&&Object.defineProperty(g,h,k)})}function xr(r,o){return[r,o,et(r,o)]}function pt(r){return Array.isArray(r)}function le(r){return r===Array||pt(r)}function dt(r){return r&&Ot(r)&&!r.prototype}function he(r){return r&&"isBuffer"in r&&typeof r.isBuffer=="function"?!0:ir(r)}function ir(r){return!!(r&&(r===Uint8Array||r instanceof Uint8Array))}function De(r){return r===Object}function $r(r){return De(x(r))&&r!==Object}function ar(r){return!r||dt(r)?!1:!(j(r)||He(r)||De(r)||Ct(r)||je(r)||le(r)||he(r))}function Ne(r){return ar(r)?x(r):r}function cr(r){return`${(Ie(r).toString().split(`
15
- `).find(o=>o.indexOf("constructor(")>-1)||"constructor()").replace("{","").trim()}`}function Lr(r){return cr(r).split("constructor(")[1].split(")")[0].split(", ").filter(Boolean).map(o=>o.trim())}function Fr(){return`e${Math.random().toString(36).substring(7)}`}const xe=r=>{const[o,i,h,g="."]=r;return zt(i)||Bt(o)?{expression:o,scope:i,defaultValue:h,separator:g}:{expression:i,scope:o,defaultValue:h,separator:g}};function Jt(...r){const o=xe(r);let i=o.scope;const{expression:h,defaultValue:g,separator:E}=o;if(!h)return i;if(!i)return g;const k=h.split(E),D=K=>{if(i){if(i[K]!==void 0||zt(i)&&K in i)return i[K];if(Ot(i.get))return i.get(K)}};for(;(i=D(k.shift()))&&k.length;);return i===void 0?g:i}function ur(r){return r&&typeof r.toJSON=="function"}function $e(r,o){let i="0.0.0.0",h=o;return typeof o=="string"&&o.indexOf(":")>-1&&([i,h]=o.split(":"),h=+h),{protocol:r,address:i,port:h,toString(){return[`${this.protocol}://${this.address}`,typeof this.port=="number"&&this.port].filter(Boolean).join(":")}}}function Qt(r,o){for(const i of kt(r)){const h=Object.getOwnPropertyDescriptor(i&&i.prototype||i,o);if(h)return h}}function fr(r){return le(r)||r===Map||r instanceof Map||r===Set||r instanceof Set||r===WeakMap||r instanceof WeakMap||r===WeakSet||r instanceof WeakSet}function Br(r){return r===""||bt(r)}function lr(r,o){const i=x(r);if(i){const h=Qt(i,o);if(h)return h.enumerable}return Object.prototype.propertyIsEnumerable.call(r,o)}function Vr(r,o,i=5){if(!r||!o)return!1;for(r=x(r),o=x(o);ht(r)!=="";){if(!i)return!1;if(r===o)return!0;r=ae(r),i--}return!1}function Kr(r){return!!(r&&r!=null&&r._isAMomentObject)}function At(r){return r&&r._bsontype}function Ur(r){return!!(ur(r)&&r.$isMongooseModelPrototype||At(r))}function Wr(r){return!(Buffer.isBuffer(r)||ce(r)||Lt(r)||te(r)||Bt(r)||bt(r))}function pe(r){return ee(r)?"string":jt(r)?"number":Ft(r)?"boolean":"any"}function Le(r,o,i,h="."){const g=o.split(h),E=(k,D)=>re(k)?!1:D?(typeof r.set=="function"?r.set(k,i):r[k]=i,!1):(typeof r.set=="function"?(r.has(k)||r.set(k,{}),r=r.get(k)):r=r[k]=r[k]||{},!0);for(;E(g.shift(),!g.length););}function H(r){return r?Bt(r)?o=>o[r]:r:(o,i)=>String(i)}function Gr(r,o){if(pt(r)){const h=H(o||"id");return r.reduce((g,E,k)=>([].concat(h(E,k)).forEach(D=>{var K;const st=g.get(D);E=((K=st==null?void 0:st.merge)==null?void 0:K.call(st,E))||E,g.set(D,E)}),g),new Map)}const i=H(o);return Object.entries(r).reduce((h,[g,E])=>h.set(i(E,g),E),new Map)}function Hr(r){return Array.from(new Set(r).values())}function zr(r,o="id"){const i=new Map;return r.forEach(h=>{i.set(h[o],h)}),Array.from(i.values())}function hr(...r){return(...o)=>{const i=typeof o[2]=="object";if(r.filter(h=>!!h).forEach(h=>{const g=h(...o);i&&typeof g=="object"&&(o[2]=g)}),i)return o[2]}}function pr(r){return(o,i)=>r(o,i,et(o,i))}function qr(...r){return(o,i)=>{r.filter(Boolean).forEach(h=>h(o,i,et(o,i)))}}a.AnyToPromise=fe,a.AnyToPromiseResponseTypes=ue,a.AnyToPromiseStatus=sr,a.CLASS_STORE=nr,a.DecoratorTypes=Z,a.Env=Pt,a.EnvTypes=Ae,a.METHOD_STORE=ne,a.Metadata=rr,a.PARAM_STORE=Se,a.PROPERTY_STORE=Gt,a.Store=F,a.StoreFn=ke,a.StoreMerge=se,a.StoreSet=Ht,a.Type=ie,a.UnsupportedDecoratorType=V,a.ancestorOf=ae,a.ancestorsOf=kt,a.catchAsyncError=W,a.catchError=Dr,a.classOf=x,a.cleanObject=Nr,a.constructorOf=Ie,a.createInstance=Je,a.decorateMethodsOf=nt,a.decoratorArgs=xr,a.decoratorTypeOf=mt,a.deepClone=Et,a.deepMerge=Ut,a.descriptorOf=et,a.getClass=q,a.getClassOrSymbol=Ne,a.getConstructor=qt,a.getConstructorArgNames=Lr,a.getHostInfoFromPort=$e,a.getInheritedClass=Ce,a.getRandomId=Fr,a.getValue=Jt,a.hasJsonMethod=ur,a.inheritedDescriptorOf=Qt,a.isArray=pt,a.isArrayOrArrayClass=le,a.isArrowFn=dt,a.isBoolean=Lt,a.isBooleanOrBooleanClass=Ft,a.isBuffer=he,a.isClass=ar,a.isClassObject=De,a.isCollection=fr,a.isDate=Ct,a.isEmpty=Br,a.isEnumerable=lr,a.isFunction=Ot,a.isInheritedFrom=Vr,a.isMethodDescriptor=Cr,a.isMomentObject=Kr,a.isMongooseObject=Ur,a.isNil=bt,a.isNumber=te,a.isNumberOrNumberClass=jt,a.isObject=zt,a.isObjectID=At,a.isObservable=Rt,a.isPlainObject=$r,a.isPrimitive=X,a.isPrimitiveClass=Vt,a.isPrimitiveOrPrimitiveClass=He,a.isPromise=je,a.isProtectedKey=re,a.isRegExp=ze,a.isSerializable=Wr,a.isStream=ce,a.isString=Bt,a.isStringOrStringClass=ee,a.isSymbol=j,a.isSymbolOrSymbolClass=qe,a.isUint8Array=ir,a.mergeReducerBuilder=Qe,a.methodsOf=rt,a.nameOf=ht,a.nameOfClass=ct,a.nameOfSymbol=Ze,a.objectKeys=Pe,a.primitiveOf=pe,a.prototypeOf=It,a.setValue=Le,a.toMap=Gr,a.toStringConstructor=cr,a.uniq=Hr,a.uniqBy=zr,a.useDecorators=hr,a.useMethodDecorator=pr,a.useMethodDecorators=qr,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}(we,we.exports)),we.exports}var on=fn();function ln(){return(ft,I)=>{const a={onAny:{[I]:{}}};on.Store.from(ft).merge("eventEmitter",a)}}function hn(ft,I){return(a,$)=>{const U={onEvent:{[$]:{event:ft,options:I}}};on.Store.from(a).merge("eventEmitter",U)}}var Ee={exports:{}},pn=Ee.exports,sn;function dn(){return sn||(sn=1,function(ft,I){(function(a,$){$(I,be)})(pn,function(a){var $=e=>{throw TypeError(e)},U=(e,t,n)=>t.has(e)||$("Cannot "+n),A=(e,t,n)=>(U(e,t,"read from private field"),n?n.call(e):t.get(e)),Q=(e,t,n)=>t.has(e)?$("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Y=(e,t,n,s)=>(U(e,t,"write to private field"),t.set(e,n),n),ot,St,tt,lt,Z,q,x;const mt=Symbol("DI_INVOKE_OPTIONS"),Ct=Symbol("DI_INJECTABLE_PROPS"),Ot="DI_USE_OPTIONS",bt="DI_USE_PARAM_OPTIONS",Lt="DI_INTERCEPTOR_OPTIONS";function Ft(e){return Array.isArray(e)}function te(e){return e===Array||Ft(e)}var jt={exports:{}},Bt=jt.exports,ee;function He(){return ee||(ee=1,function(e,t){(function(n,s){s(t)})(Bt,function(n){var s=w=>{throw TypeError(w)},c=(w,_,M)=>_.has(w)||s("Cannot "+M),l=(w,_,M)=>(c(w,_,"read from private field"),M?M.call(w):_.get(w)),b=(w,_,M)=>_.has(w)?s("Cannot add the same private member more than once"):_ instanceof WeakSet?_.add(w):_.set(w,M),m;function T(w,_){return!w||!_.ref||w&&_.ref===w}class L{constructor(){b(this,m,new Map)}has(_){var M;return!!((M=l(this,m).get(_))!=null&&M.length)}on(_,M,R){let d=M;R||(R=d,d=void 0);const y=l(this,m).get(_)||[];return y.push({cb:R,ref:d}),l(this,m).set(_,y),this}once(_,M,R){R||(R=M);const d=(...y)=>{R(...y),this.off(_,d)};return this.on(_,M,d),this}off(_,M){const R=(d,y)=>{y.length?l(this,m).set(d,y):l(this,m).delete(d)};if(typeof _=="string"&&M){let d=l(this,m).get(_);d&&R(_,d.filter(y=>y.cb!==M))}else{const d=_;l(this,m).forEach((y,O)=>{R(O,y.filter(P=>P.ref!==d))})}return this}emit(_,M,R){Array.isArray(M)&&(R=M,M=void 0),R||(R=[]);const d=l(this,m).get(_);if(d!=null&&d.length)for(const y of d)T(M,y)&&y.cb.apply(null,R)}async asyncEmit(_,M,R){Array.isArray(M)&&(R=M,M=void 0);const d=l(this,m).get(_);if(d!=null&&d.length){const y=d.filter(O=>T(M,O)).map(O=>O.cb.apply(null,R));await Promise.all(y)}}alter(_,M,R=[],d=null){const y=l(this,m).get(_);if(y!=null&&y.length)for(const{cb:O}of y)M=O.call(d,M,...R);return M}async asyncAlter(_,M,R=[],d=null){const y=l(this,m).get(_);if(y!=null&&y.length)for(const O of y)M=await O.cb.call(d,M,...R);return M}destroy(){l(this,m).clear()}}m=new WeakMap;const N=new L,at=N.on.bind(N),Mt=N.once.bind(N),ut=N.off.bind(N),u=N.emit.bind(N),f=N.asyncEmit.bind(N),p=N.alter.bind(N),v=N.asyncAlter.bind(N);n.$alter=p,n.$asyncAlter=v,n.$asyncEmit=f,n.$emit=u,n.$off=ut,n.$on=at,n.$once=Mt,n.Hooks=L,n.hooks=N,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})})}(jt,jt.exports)),jt.exports}var X=He();class Vt extends Map{constructor(){super(...arguments),this.hooks=new X.Hooks}async destroy(){await this.hooks.asyncEmit("$onDestroy")}}function ze(e){return e.prototype?e:e.constructor}function j(e){return ze(e)}function qe(e){return e===Date||e instanceof Date&&!isNaN(+e)}function wt(e){return typeof e=="function"}function Et(e){return e==null}function Je(e){return typeof e=="boolean"||e instanceof Boolean||e===Boolean}function re(e){return typeof e=="boolean"||e instanceof Boolean||e===Boolean}function Pe(e){return typeof e=="number"}function Qe(e){return typeof e=="number"||e instanceof Number||e===Number}function Kt(e){return typeof e=="string"}function kr(e){return typeof e=="string"||e instanceof String||e===String}function Ar(e){return kr(e)||Qe(e)||re(e)}function Ye(e){return Kt(e)||Pe(e)||Je(e)}function Ut(e){return e instanceof RegExp}function et(e){return typeof e=="symbol"}const Cr=e=>Et(e)||Ye(e)||et(e)||wt(e),ct=(e,t=new WeakMap)=>{if(Cr(e))return e;const n=t.get(e);if(n)return n;if(ArrayBuffer.isView(e))return Buffer.isBuffer(e)?Buffer.from(e):new(j(e))(e.buffer.slice(0),e.byteOffset,e.byteLength);if(qe(e))return new Date(e);if(Ut(e))return new RegExp(e);if(Array.isArray(e)){const c=[];return t.set(e,c),e.forEach((l,b)=>c[b]=ct(l,t)),c}if(e instanceof Map){const c=new Map;return t.set(e,c),e.forEach((l,b)=>c.set(ct(b,t),ct(l,t))),c}if(e instanceof Set){const c=new Set;return t.set(e,c),e.forEach(l=>c.add(ct(l,t))),c}const s=Object.create(Reflect.getPrototypeOf(e));return t.set(e,s),Reflect.ownKeys(e).forEach(c=>{const l=Object.getOwnPropertyDescriptor(e,c);l&&(wt(l.value)?Object.defineProperty(s,c,l):Object.defineProperty(s,c,{...l,value:ct(l.value,t)}))}),s};function Ze(e){return e?j(e)!==Object?Object.create(e):{}:{}}function ht(e){return["__proto__","constructor","prototype"].includes(e)}function Re(e){return Object.keys(e).filter(t=>!ht(t))}function Xe(e){return(t,n,s)=>{const c=t.findIndex(l=>e(l,n));return c===-1?[...t,n]:(t[c]=Tt(t[c],n,s),t)}}const Me=Xe((e,t)=>e===t);function jr({reducers:e,parentKey:t}){return e?t&&e[t]?e[t]:e.default||Me:Me}function _e(e,t){return Ye(e)||et(e)||wt(e)||t===void 0}function tr(e,t){return e==null||e===""&&t!==""}function Tt(e,t,n={}){if(tr(t,e))return e;if(_e(t,e))return t;if(Array.isArray(e)){const c=jr(n);return[].concat(t).reduce((l,b)=>c(l,b,n),[...e])}const s=Ze(e);return[...Re(e),...Re(t)].reduce((c,l)=>{var b;const m=e&&e[l],T=Tt(m,t&&t[l],{...n,parentKey:l});return n.cleanUndefinedProps&&T===void 0||(c[l]=((b=n.alter)==null?void 0:b.call(n,l,T))??T),c},s)}function Wt(e){return e&&wt(e)&&!e.prototype}function er(e){return e&&"isBuffer"in e&&typeof e.isBuffer=="function"?!0:rr(e)}function rr(e){return!!(e&&(e===Uint8Array||e instanceof Uint8Array))}function nr(e){return e===Object}function ne(e){return e===Promise||e instanceof Promise||!!e&&typeof e.subscribe!="function"&&typeof e.then=="function"}function Gt(e){return!e||Wt(e)?!1:!(et(e)||Ar(e)||nr(e)||qe(e)||ne(e)||te(e)||er(e))}function Se(e){return e&&Object.getPrototypeOf(e)}function Te(e){return Se(e)}function oe(e){return typeof e=="function"?e.name:e.constructor.name}const Ir=e=>e.toString().replace("Symbol(","").replace(")","");function F(e){switch(typeof e){default:return""+e;case"symbol":return Ir(e);case"function":return oe(e)}}function ke(e,t,n=5){if(!e||!t)return!1;for(e=j(e),t=j(t);F(e)!=="";){if(!n)return!1;if(e===t)return!0;e=Se(e),n--}return!1}function se(e){return typeof e=="object"}function Ht(e){return Gt(e)?j(e):e}var V;(function(e){e.PARAM="parameter",e.PARAM_CTOR="parameter.constructor",e.PARAM_STC="parameter.static",e.PROP="property",e.PROP_STC="property.static",e.METHOD="method",e.METHOD_STC="method.static",e.CLASS="class"})(V||(V={}));function Pt(e){const[t,n,s]=e,c=l=>t!==j(t)?l:`${l}.static`;return typeof s=="number"?n?c("parameter"):"parameter.constructor":s&&s.value?c("method"):n&&s===void 0||s?c("property"):V.CLASS}function Ae(e,t){return Reflect.getOwnPropertyDescriptor(e&&e.prototype||e,t)}const ie="design:paramtypes",ae="design:type",Ce="design:returntype",kt=new Map,zt=class{static get(t,n,s){return Reflect.getMetadata(t,j(n),s)}static getOwn(t,n,s){return Reflect.getOwnMetadata(t,j(n),s)}static getType(t,n){return Reflect.getMetadata(ae,t,n)}static getOwnType(t,n){return Reflect.getMetadata(ae,t,n)}static getReturnType(t,n){return Reflect.getMetadata(Ce,t,n)}static getOwnReturnType(t,n){return Reflect.getOwnMetadata(Ce,t,n)}static has(t,n,s){try{return Reflect.hasMetadata(t,j(n),s)}catch{}return!1}static hasOwn(t,n,s){return Reflect.hasOwnMetadata(t,j(n),s)}static delete(t,n,s){return Reflect.deleteMetadata(t,j(n),s)}static setParamTypes(t,n,s){return this.set(ie,s,t.prototype,n)}static set(t,n,s,c){const l=kt.has(t)?kt.get(t)||[]:[],b=j(s);l.indexOf(b)===-1&&(l.push(b),kt.set(t,l)),Reflect.defineMetadata(t,n,j(s),c)}static getParamTypes(t,n){return Reflect.getMetadata(ie,t,n)||[]}static getOwnParamTypes(t,n){return Reflect.getOwnMetadata(ie,t,n)||[]}};zt.getTargetsFromPropertyKey=e=>kt.has(e)?kt.get(e)||[]:[];let Rt=zt;const je="tsed:class:store",ce="tsed:method:store",or="tsed:property:store",sr="tsed:param:store",ue=new Map;function fe(e,...t){if(et(t[0]))return ue.has(t[0])||ue.set(t[0],new W),ue.get(t[0]);{const n=Rt;return n.hasOwn(e,...t)||n.set(e,new W,...t),n.getOwn(e,...t)}}function Dr(e){const[t,n,s]=e;switch(Pt(e)){case V.PARAM_CTOR:case V.PARAM_STC:case V.PARAM:const c=fe(sr,t,n);return c.has(""+s)||c.set(""+s,new W),c.get(""+s);case V.PROP:case V.PROP_STC:return fe(or,t,n);case V.METHOD:case V.METHOD_STC:return fe(ce,t,n);case V.CLASS:return fe(je,t)}}class W{constructor(){this._entries=new Map}static from(...t){return Dr(t)}static fromMethod(t,n){return W.from(t,n,Ae(t,n))}static mergeStoreFrom(t,n,...s){const c=W.from(t,...s);return W.from(n,...s)._entries.forEach((l,b)=>{c.merge(b,l)}),c}static mergeStoreMethodFrom(t,n,s){return this.mergeStoreFrom(t,n,s,Ae(t,s))}get(t,n){return this._entries.get(F(t))||n}has(t){return this._entries.has(F(t))}set(t,n){return this._entries.set(F(t),n),this}delete(t){return this._entries.delete(F(t))}merge(t,n,s=!1){let c=this.get(t);return c&&(n=ct(n),c=ct(c),n=s?Tt(n,c):Tt(c,n)),this.set(t,n),this}toJson(){return[...this._entries.entries()].reduce((t,[n,s])=>({...t,[n]:s}),{})}}function Nr(e){const t=[];let n=j(e);for(;n&&F(n)!=="";)t.unshift(n),n=Te(n);return t}function qt(e){return j(e)===e?e.prototype:e}function Ie(e){const t=new Map;return e=j(e),Nr(e).forEach(n=>{Reflect.ownKeys(qt(n)).forEach(s=>{var c;et(s)||s==="constructor"||(c=Object.getOwnPropertyDescriptor(qt(n),s))!=null&&c.get||t.set(s,{target:n,propertyKey:s})})}),Array.from(t.values())}function It(e){return Ie(e).reduce((t,{propertyKey:n})=>{if(String(n).startsWith("$")){const s=(c,...l)=>c==null?void 0:c[n](...l);return{...t,[n]:s}}return t},{})}var rt=(e=>(e.SINGLETON="singleton",e.REQUEST="request",e.INSTANCE="instance",e))(rt||{}),nt=(e=>(e.VALUE="value",e.PROVIDER="provider",e.MODULE="module",e.CONTROLLER="controller",e.INTERCEPTOR="interceptor",e.MIDDLEWARE="middleware",e))(nt||{});const xr=class cn{constructor(t,n={}){Q(this,ot),Q(this,St),Q(this,tt),Q(this,lt),this.type=nt.PROVIDER,this.hooks={},this.token=t,this.useClass=t,Object.assign(this,n),n instanceof cn&&(Y(this,ot,A(n,ot)),Y(this,tt,A(n,tt)),Y(this,lt,A(n,lt)))}get token(){return A(this,St)}set token(t){t&&(Y(this,St,Ht(t)),Y(this,lt,Y(this,tt,W.from(t))))}get provide(){return this.token}set provide(t){this.token=t}get useClass(){return A(this,ot)}set useClass(t){Gt(t)&&(Y(this,ot,j(t)),Y(this,tt,W.from(t)),this.hooks=It(A(this,ot)))}get className(){return this.name}get name(){return F(this.token)}get store(){return A(this,tt)}get path(){return this.store.get("path","/")}set path(t){this.store.set("path",t)}get scope(){return this.isAsync()?rt.SINGLETON:this.get("scope",rt.SINGLETON)}set scope(t){this.store.set("scope",t)}get configuration(){return this.get("configuration")}set configuration(t){this.store.set("configuration",t)}get children(){return this.store.get("childrenControllers",[])}set children(t){this.store.set("childrenControllers",t)}getArgOpts(t){return this.store.get(`${bt}:${t}`)}get(t,n){return this.store.get(t)||A(this,lt).get(t)||n}isAsync(){return!!this.useAsyncFactory}clone(){return new(j(this))(this.token,this)}hasChildren(){return!!this.children.length}hasParent(){return!!this.store.get("parentController")}toString(){return["Token",this.name,this.useClass&&F(this.useClass),this.useFactory&&"Factory",this.useValue&&"Value",this.useAsyncFactory&&"AsyncFactory"].filter(Boolean).join(":")}reset(){return this.useValue=void 0,this.useFactory=void 0,this.useAsyncFactory=void 0,this}};ot=new WeakMap,St=new WeakMap,tt=new WeakMap,lt=new WeakMap;let pt=xr;class le extends Map{constructor(){super(...arguments),Q(this,Z,new Map)}get(t){return super.get(Ht(t))}has(t){return super.has(Ht(t))}set(t,n){return super.set(Ht(t),n),this}merge(t,n){if(n.global===!1)return dt.createProvider(t,n);const s=this.createIfNotExists(t,n);return Object.keys(n).forEach(c=>{s[c]=n[c]}),this.set(t,s),s}delete(t){return super.delete(Ht(t))}createRegistry(t,n,s={}){const c=this.getRegistrySettings(t);return s=Object.assign(c,{...s,model:n}),A(this,Z).set(t,s),this}getRegistrySettings(t){let n=nt.PROVIDER;if(typeof t=="string")n=t;else{const s=this.get(t);s&&(n=s.type)}return A(this,Z).get(n)||{model:pt}}createProvider(t,n){const s=n.type||nt.PROVIDER,{model:c=pt}=A(this,Z).get(s)||{};return new c(t,n)}createIfNotExists(t,n){if(!this.has(t)){const s=this.createProvider(t,n);this.set(t,s)}return this.get(t)}}Z=new WeakMap;const dt=new le;class he extends Map{add(t,n={}){var s;const c=((s=dt.get(t))==null?void 0:s.clone())||new pt(t);return Object.assign(c,n),super.set(t,c)}addProvider(t,n={}){return this.add(t,n)}hasProvider(t){return super.has(t)}setProvider(t,n){return super.set(t,n)}getProvider(t){return super.get(t)}getProviders(t){const n=[].concat(t).map(String);return[...this].reduce((s,[c,l])=>n.includes(String(l.type))||!t?[...s,l]:s,[])}addProviders(t){t.forEach(n=>{this.hasProvider(n.token)||this.setProvider(n.token,n.clone())})}}function ir(e){return typeof e=="function"?e:e.constructor}function De(e){return ir(e)}function $r(e){return`${(De(e).toString().split(`
16
- `).find(t=>t.indexOf("constructor(")>-1)||"constructor()").replace("{","").trim()}`}function ar(e){return $r(e).split("constructor(")[1].split(")")[0].split(", ").filter(Boolean).map(t=>t.trim())}const Ne=e=>t=>!process.env.NO_COLOR&&process.env.NODE_ENV!=="production"?e(t):t,cr=Ne(e=>`\x1B[31m${e}\x1B[39m`),Lr=Ne(e=>`\x1B[33m${e}\x1B[39m`),Fr=Ne(e=>`\x1B[32m${e}\x1B[39m`),xe={red:cr,yellow:Lr,green:Fr};class Jt extends Error{constructor(t,n){super(Kt(n)?n:""),this.name="INJECTION_ERROR",this.tokens=[],this.tokens=[t],n&&(Kt(n)?this.origin={message:n,stack:this.stack}:n.tokens?(this.tokens=this.tokens.concat(n.tokens),this.origin=n.origin):(this.origin=n,this.stack=n.stack));const s=this.origin?`
17
- Origin: `+this.origin.message:"",c=this.tokens.map(l=>F(l)).join(" > ");this.message=`Injection failed on ${c}${s}`}static throwInjectorError(t,n,s){throw n&&Gt(t)&&(s.message=ur(t,{...n,message:s.message})),new Jt(t,s)}}function ur(e,t){let n="";const s=ar(e).map((m,T)=>(t.index===T&&(n=m,m=xe.red(m)),`${m}: ${F(t.deps[T])}`)).join(", "),c=F(e)+"->constructor("+s+")",l=c.indexOf(n)-5,b=m=>" ".repeat(m)+xe.red("^"+"‾".repeat(n.length-1));return"Unable to inject dependency. "+t.message+`
18
-
19
- `+c+`
20
- `+(l>-1?b(l):"")}function $e(e){const t=new he(dt.entries());return e&&t.delete(e),t}function Qt(e,t){return Rt.getOwn("override:ctor:design:paramtypes",e,t)||[...Rt.getParamTypes(e,t)]}function fr(e,t){Rt.set("override:ctor:design:paramtypes",t,e)}const Br=e=>{const[t,n,s,c="."]=e;return se(n)||Kt(t)?{expression:t,scope:n,defaultValue:s,separator:c}:{expression:n,scope:t,defaultValue:s,separator:c}};function lr(...e){const t=Br(e);let n=t.scope;const{expression:s,defaultValue:c,separator:l}=t;if(!s)return n;if(!n)return c;const b=s.split(l),m=T=>{if(n){if(n[T]!==void 0||se(n)&&T in n)return n[T];if(wt(n.get))return n.get(T)}};for(;(n=m(b.shift()))&&b.length;);return n===void 0?c:n}function Vr(e,t,n,s="."){const c=t.split(s),l=(b,m)=>ht(b)?!1:m?(typeof e.set=="function"?e.set(b,n):e[b]=n,!1):(typeof e.set=="function"?(e.has(b)||e.set(b,{}),e=e.get(b)):e=e[b]=e[b]||{},!0);for(;l(c.shift(),!c.length););}const Kr=Symbol.for("CONFIGURATION");class At{constructor(t={}){this.default=new Map,this.map=new Map,Object.entries({imports:[],routes:[],logger:{},...t}).forEach(([n,s])=>{this.default.set(n,s)})}get version(){return this.get("version")}set version(t){this.map.set("version",t)}get rootDir(){return this.get("rootDir")}set rootDir(t){this.map.set("rootDir",t)}get env(){return this.map.get("env")}set env(t){this.map.set("env",t)}get imports(){return this.get("imports")}set imports(t){this.map.set("imports",t)}get routes(){return this.get("routes")}set routes(t){this.map.set("routes",t)}get logger(){return this.get("logger")}set logger(t){const n={...this.logger,...t};this.map.set("logger",n)}get debug(){return this.logger.level==="debug"}set debug(t){this.logger={...this.logger,level:t?"debug":"info"}}forEach(t,n){return new Set([...Array.from(this.default.keys()),...Array.from(this.map.keys())]).forEach(s=>{t(this.getRaw(s),s,this.map)},n)}set(t,n){return typeof t=="string"?Reflect.has(this,t)?this[t]=n:this.setRaw(t,n):Object.entries(t).forEach(([s,c])=>{this.set(s,c)}),this}setRaw(t,n){return Vr(this.map,t,n),this}get(t,n){return this.getRaw(t,n)}getRaw(t,n){const s=lr(this.map,t);return s!==void 0?s:lr(this.default,t,n)}}const Ur=["mount","imports"],Wr=class rn extends he{constructor(){super(),Q(this,q),Q(this,x),this.logger=console,this.resolvedConfiguration=!1,Y(this,q,new Vt),Y(this,x,!1),A(this,q).set(rn,this),A(this,q).set(At,new At)}get settings(){return A(this,q).get(At)}set settings(t){A(this,q).set(At,t)}isLoaded(){return A(this,x)}toArray(){return[...A(this,q).values()]}get(t,n){return this.has(t)?A(this,q).get(t):this.resolve(t,n)}getMany(t,n){return this.getProviders(t).map(s=>this.resolve(s.token,n))}has(t){return A(this,q).get(t)!==void 0}alias(t,n){return A(this,q).set(n,A(this,q).get(t)),this}resolve(t,n={}){let s=n.locals?n.locals.get(t):void 0;if(s!==void 0)return s;if(t===bt)return n.useOpts;if(s=n.rebuild?void 0:A(this,q).get(t),s!=null)return s;const c=this.ensureProvider(t);if(!c||n.rebuild)return s=this.invokeToken(t,n),c?this.setToCache(c,s):s;switch(s=this.invokeToken(t,n),c.scope){case rt.SINGLETON:return n.rebuild||this.registerHooks(c,n),this.setToCache(c,s);case rt.REQUEST:return n.locals&&(n.locals.set(c.token,s),this.registerHooks(c,n)),s}return s}invoke(t,n={}){return this.resolve(t,n)}async loadAsync(){for(const[,t]of this)!this.has(t.token)&&t.isAsync()&&await this.resolve(t.token)}loadSync(){for(const[,t]of this)!this.has(t.token)&&t.scope===rt.SINGLETON&&this.resolve(t.token)}async load(t=$e()){Y(this,x,!0),await X.$asyncEmit("$beforeInit"),await this.bootstrap(t),await this.loadAsync(),this.loadSync(),await X.$asyncEmit("$onInit")}async resolveConfiguration(){if(this.resolvedConfiguration)return;const t=new Map;super.forEach(n=>{n.configuration&&n.type!=="server:module"&&Object.entries(n.configuration).forEach(([s,c])=>{Ur.includes(s)||(c=t.has(s)?Tt(t.get(s),c):ct(c),t.set(s,c))})}),t.forEach((n,s)=>{this.settings.set(s,Tt(n,this.settings.get(s)))}),await X.$asyncEmit("$afterResolveConfiguration",this.settings),this.resolvedConfiguration=!0}emit(t,...n){return X.$asyncEmit(t,n)}alter(t,n,...s){return X.$alter(t,n,s)}alterAsync(t,n,...s){return X.$asyncAlter(t,n,s)}async destroy(){await X.$asyncEmit("$onDestroy"),A(this,q).forEach((t,n)=>{X.$off(n)})}async bootstrap(t=$e()){return this.addProviders(t),await this.resolveConfiguration(),this.resolveImportsProviders(),this}ensureProvider(t,n=!1){return!this.hasProvider(t)&&(dt.has(t)||n)&&this.addProvider(t),this.getProvider(t)}invokeToken(t,n={}){const s=this.mapInvokeOptions(t,n);if(!s)return;const{token:c,deps:l,construct:b,imports:m,provider:T}=s;X.$emit("$beforeInvoke",c,[s]),X.$emit(`$beforeInvoke:${String(T.type)}`,[s]);let L,N=!1;try{const at=ut=>(u,f)=>(N={token:u,index:f,deps:l},Ft(u)?this.getMany(u[0],n):ke(u,pt,1)?T:this.resolve(u,{parent:ut,locals:n.locals,useOpts:(T==null?void 0:T.getArgOpts(f))||n.useOpts}));m.forEach(at());const Mt=l.map(at(c));N=!1,L=b(Mt)}catch(at){Jt.throwInjectorError(c,N,at)}if(L===void 0)throw new Jt(c,`Unable to create new instance from undefined value. Check your provider declaration for ${F(c)}`);return L&&Gt(j(L))&&Reflect.defineProperty(L,mt,{get:()=>({rebuild:n.rebuild,locals:n.locals})}),X.$emit("$afterInvoke",c,[L,s]),L}resolveImportsProviders(){var t;this.settings.imports=(t=this.settings.imports)==null?void 0:t.filter(n=>se(n)&&"token"in n&&n.token!==rn).map(n=>{if(se(n)&&"token"in n){const{token:s,...c}=n,l=this.ensureProvider(s,!0);if(l){if(l.useValue=void 0,l.useAsyncFactory=void 0,l.useFactory=void 0,"useClass"in c){l.useClass=c.useClass;return}if("useFactory"in c){l.useFactory=c.useFactory;return}if("useAsyncFactory"in c){l.useAsyncFactory=c.useAsyncFactory;return}if("use"in c){l.useValue=c.use;return}}}return n}).filter(Boolean)}mapInvokeOptions(t,n){const s=n.locals||new Vt;n.locals=s;let c=n.imports,l=n.deps,b;if(!t||t===Object)throw new Error("Given token is undefined. Could mean a circular dependency problem. Try to use @Inject(() => Token) to solve it.");let m;if(this.hasProvider(t)?m=this.getProvider(t):m=new pt(t),l=l||m.deps,c=c||m.imports,m.useValue!==void 0)b=()=>wt(m.useValue)?m.useValue():m.useValue;else if(m.useFactory)b=T=>m.useFactory(...T);else if(m.useAsyncFactory)b=async T=>(T=await Promise.all(T),m.useAsyncFactory(...T));else if(m.useClass)l=l||Qt(m.useClass),b=T=>new m.useClass(...T);else return!1;return{token:t,deps:l||[],imports:c||[],construct:b,provider:m,locals:s}}registerHooks(t,n){var s;if(t.hooks){if(t.scope===rt.REQUEST){if(n.locals&&(s=t.hooks)!=null&&s.$onDestroy){const{locals:c}=n;n.locals.hooks.on("$onDestroy",(...l)=>{var b,m;return(m=(b=t.hooks)==null?void 0:b.$onDestroy)==null?void 0:m.call(b,c.get(t.token),...l)})}return}Object.entries(t.hooks).forEach(([c,l])=>{const b=(...m)=>l(A(this,q).get(t.token),...m);X.$on(c,t.token,b)})}}setToCache(t,n){const s=c=>{A(this,q).set(t.token,c),t!=null&&t.alias&&this.alias(t.token,t.alias)};return"isAsync"in t&&!t.isAsync()&&!ne(n)?(s(n),n):(s(n),n=n.then(c=>(s(c),c)),n)}};q=new WeakMap,x=new WeakMap;let pe=Wr,Le=new pe;function H(){return Le}async function Gr(){await Le.destroy(),Le=new pe}function Hr(e,t){const n=H(),s=new Vt,c=Qt(e),l=[],b=Math.max(c.length,t.length);for(let m=0;m<b;m++)if(t[m]!==void 0)l.push(t[m]);else{const T=c[m],L=Ft(T)?n.getMany(T[0],{locals:s,parent:e}):n.invoke(T,{locals:s,parent:e});l.push(L)}return l}function zr(){return e=>class extends e{constructor(...t){super(...Hr(e,t))}}}function hr(e,t){if(e){const n=W.from(e);return t&&n.set("configuration",t),n.get("configuration",t)}return H().settings}class pr extends pt{constructor(t,n={}){super(t,n),this.type=nt.CONTROLLER}get middlewares(){return Object.assign({use:[],useAfter:[],useBefore:[]},this.store.get("middlewares",{}))}set middlewares(t){const n=this.middlewares,s=(c,l,b)=>l[c]=l[c].concat(b[c]);Object.keys(t).forEach(c=>{s(c,n,t)}),this.store.set("middlewares",n)}}dt.createRegistry(nt.CONTROLLER,pr);function qr({token:e,provide:t,...n}){return i(e||t,{...n,token:e||t}).inspect()}function r(e,t={}){return(n,s={})=>{const c={global:!H().isLoaded(),...s,...t,token:n},l=dt.merge(n,c);return c.global||H().setProvider(n,l),e.reduce((b,m)=>({...b,[m]:function(T){return l[m]=T,this}}),{factory(b){return l.reset(),l.useFactory=b,this},asyncFactory(b){return l.reset(),l.useAsyncFactory=b,this},value(b){return l.reset(),l.useValue=b,l.type=nt.VALUE,this},class(b){return l.reset(),l.useClass=b,this},store(){return l.store},inspect(){return l},token(){return l.token}})}}const o=["type","scope","path","alias","hooks","deps","imports","configuration","priority"],i=r(o),h=r(o,{type:nt.INTERCEPTOR}),g=r([...o,"middlewares"],{type:nt.CONTROLLER});function E(e){try{e()}catch(t){return t}}class k extends Error{constructor(t,n){super(`Object isn't a valid token. Please check the token set on ${F(j(t))}.${n}.
21
- - Check that it is not a circular reference.
22
- - Check that the token (class or symbol) exists`),this.name="INVALID_TOKEN_ERROR"}}let D,K={};const st=[];function yt({providers:e,rebuild:t}={}){return(!D||e)&&(D=new Vt,e&&(e.forEach(n=>{D.set(n.token,n.use)}),D.set(pe,H())),t&&(K.rebuild=t)),D}function gt(){return{...K}}function Dt(){D&&st.push(D),D=void 0,K={}}function Yt(){Dt(),st.map(e=>e.clear())}function Nt(e,t){return H().resolve(e,{...t,...gt(),locals:(t==null?void 0:t.locals)||yt()})}function de(e,t){return H().getMany(e,{...t,locals:(t==null?void 0:t.locals)||yt()})}function xt(e,{target:t,propertyKey:n,parameterIndex:s}){const c=Qt(t,n),l=c[s];c[s]=l===Array?[e]:e,Rt.setParamTypes(t,n,c),fr(t,c)}function ye(e,t,n){const s=e||Rt.getType(t,n);if(s===Object)throw new k(t,String(n));return s}function dr(e,t,{token:n,transform:s=l=>l,useOpts:c}){const l=Symbol();e[Ct]||Reflect.defineProperty(e,Ct,{value:new Set,enumerable:!1,configurable:!1}),e[Ct].add(t),E(()=>Reflect.deleteProperty(e,t)),Reflect.defineProperty(e,t,{get(){var b,m;const T=ye(n,e,t),L=Rt.getType(e,t),N={rebuild:!!((b=this[mt])!=null&&b.rebuild),locals:(m=this[mt])==null?void 0:m.locals,useOpts:c||W.from(e,t).get(Ot)};return this[l]===void 0&&(this[l]=L===Array?de(n,N):Nt(T,N)),[].concat(this[l]).forEach((at,Mt)=>{ne(this[l])&&at.then(ut=>{this[l][Mt]=ut,L!==Array&&(this[l]=ut)})}),s(this[l],{self:this,target:e,propertyKey:t})}})}function Fe(e,t={}){return t=typeof t=="function"?{transform:t}:t,(n,s,c)=>{switch(Pt([n,s,c])){case V.PARAM_CTOR:e&&xt(e,{target:n,propertyKey:s,parameterIndex:c});break;case V.PROP:dr(n,s,{...t,token:e})}}}function Be(e={}){return(...t)=>{switch(Pt(t)){case V.CLASS:hr(t[0],e);break;default:case V.PARAM_CTOR:return Fe(At)(t[0],t[1],t[2])}}}i(Be).factory(()=>H().settings);function Ve(e,t){return H().settings.get(e,t)}function yr(e,t,n,s){const c=Symbol();E(()=>Reflect.deleteProperty(e,t)),Reflect.defineProperty(e,t,{get(){if(this[c]!==void 0)return this[c];const l=Ve(n,s);return this[c]=Object.freeze(ct(l)),this[c]},set(l){(Ve(n,s)||this[c])===void 0&&l!==void 0&&(this[c]=l)},enumerable:!0,configurable:!0})}function Jr(e,t){return(n,s)=>yr(n,s,e,t)}function gr(...e){return(...t)=>{const n=typeof t[2]=="object";if(e.filter(s=>!!s).forEach(s=>{const c=s(...t);n&&typeof c=="object"&&(t[2]=c)}),n)return t[2]}}function Qr(e){return typeof e=="string"||e instanceof RegExp||te(e)?{path:e}:e}function Yr(e){const{children:t=[],path:n,...s}=Qr(e);return gr(c=>{const l=g(c,s);n&&l.store().set("path",n),l.store().set("childrenControllers",t),t.forEach(b=>{W.from(b).set("parentController",j(c))})})}function ge(e={}){return t=>{const n={...e,...e.token?{useClass:t}:{token:t}};i(n.token,n)}}function Zr(e,t){Ie(e).forEach(({target:n,propertyKey:s})=>{const c=qt(e);n!==j(e)&&(Object.defineProperty(c,s,{writable:!0,configurable:!0,value(...m){return qt(n)[s].apply(this,m)}}),W.mergeStoreMethodFrom(e,n,s));let l=Ae(e,s);const b=t(c,s,l)||l;b&&Object.defineProperty(c,s,b)})}function Xr(e,t){return W.fromMethod(e,t).get(Lt)}function vr(e,t,n,s){const c=j(e),l=Reflect.getOwnPropertyDescriptor(c.prototype,t),b=l.value,m=Symbol();W.fromMethod(c,t).set(Lt,s);function T(...L){var N,at;const Mt=f=>{if(!f)return b.apply(this,L);throw f},ut={target:c,propertyKey:t,args:L,options:s,next:Mt},u={rebuild:!!((N=this[mt])!=null&&N.rebuild),locals:(at=this[mt])==null?void 0:at.locals};return this[m]=this[m]||Nt(n,u),this[m].intercept({...ut,options:s},Mt)}return l.value=T,Reflect.deleteProperty(c.prototype,t),Reflect.defineProperty(c.prototype,t,l),l}function Ke(e,t){return(...n)=>{const[s,c]=n;switch(Pt(n)){case V.CLASS:Zr(s,Ke(e,t));break;case V.METHOD:return vr(s,c,e,t)}}}function Ue(){return ge({type:nt.INTERCEPTOR})}async function ve(e){const{default:t}=await e();if(!H().has(t)){const n=await Nt(t);"$onInit"in n&&wt(n.$onInit)&&await n.$onInit()}return H().get(t)}async function We(e){try{return await ve(e)}catch{return}}function Ge(e,t=!1){function n(s,c){return async()=>{try{const{[s]:l}=await c();return{default:l}}catch(l){if(!t)throw l;return}}}return wt(e[0])?n("default",e[0]):n(e[0],e[1])}function mr(...e){let t=Ge(e);return(n,s)=>{E(()=>Reflect.deleteProperty(n,s)),Reflect.defineProperty(n,s,{async get(){return ve(t)}})}}function Or(...e){const t=Ge(e,!0);return(n,s)=>{E(()=>Reflect.deleteProperty(n,s)),Reflect.defineProperty(n,s,{async get(){return We(t)}})}}function br(e={}){const{scopes:t,imports:n,deps:s,scope:c,...l}=e;return gr(Be(l),ge({type:nt.MODULE,scope:rt.SINGLETON,imports:n,deps:s,injectable:!1}))}function S(e){return(...t)=>{const n=W.from(...t),s=e(n,t);return typeof s=="function"&&s(...t),t[2]}}function $t(e,t){return S(n=>{n.set(e,t)})}function wr(e=rt.REQUEST){return $t("scope",e)}function G(e,t,n){wr(rt.INSTANCE)(j(e)),Fe(bt)(e,t,n)}function tn(e){return t=>{dt.get(e).useClass=t}}function en(){return ge()}class me extends Error{constructor(t,n){super(me.buildMessage(t,n))}static buildMessage(t,n){const[s,c,l]=n,b=Pt(n),m=b.split("/")[0],T=m==="parameter"?".["+l+"]":"",L=c?"."+c:m==="parameter"?".constructor":"",N=F(j(s))+L+T;return`${t.name} cannot be used as ${b} decorator on ${N}`}}function Er(e){return(t,n,s)=>{switch(Pt([t,n,s])){case V.PARAM_CTOR:W.from(t).merge(`${bt}:${s}`,e);break;case V.PROP:W.from(t,n).set(Ot,e);break;default:throw new me(Er,[t,n,s])}}}function it(e,t,n,s){const c={get(){return H().settings.get(n,s)},set(l){H().settings.set(n,l)},enumerable:!0,configurable:!0};E(()=>Reflect.deleteProperty(e,t)),E(()=>Reflect.defineProperty(e,t,c))}function Pr(e,t){return(n,s)=>it(n,s,e,t)}var Zt=(e=>(e.METHOD="method",e.PROPERTY="property",e.CONSTANT="constant",e.VALUE="value",e.INTERCEPTOR="interceptor",e))(Zt||{});function Rr(e,t){return Object.freeze({get value(){return H().settings.get(e,t)},set value(n){H().settings.set(e,n)}})}const Mr=Symbol.for("LOGGER");i(Mr).factory(()=>H().logger);function Oe(e={},t={}){return Object.entries(t).reduce((n,[s,c])=>({...n,[s]:(n[s]||[]).concat(c)}),e)}function _r(e,t={}){const n=W.from(e).get("configuration")||{};return{...n,...t,mount:Oe(n.mount,t.mount)}}a.AutoInjectable=zr,a.CONFIGURATION=Kr,a.Configuration=Be,a.Constant=Jr,a.Container=he,a.Controller=Yr,a.ControllerProvider=pr,a.DIConfiguration=At,a.DI_INJECTABLE_PROPS=Ct,a.DI_INTERCEPTOR_OPTIONS=Lt,a.DI_INVOKE_OPTIONS=mt,a.DI_USE_OPTIONS=Ot,a.DI_USE_PARAM_OPTIONS=bt,a.GlobalProviderRegistry=le,a.GlobalProviders=dt,a.Inject=Fe,a.Injectable=ge,a.InjectablePropertyType=Zt,a.InjectionError=Jt,a.InjectorService=pe,a.Intercept=Ke,a.Interceptor=Ue,a.InvalidPropertyTokenError=k,a.LOGGER=Mr,a.LazyInject=mr,a.LocalsContainer=Vt,a.Module=br,a.OptionalLazyInject=Or,a.Opts=G,a.OverrideProvider=tn,a.Provider=pt,a.ProviderScope=rt,a.ProviderType=nt,a.Scope=wr,a.Service=en,a.UseOpts=Er,a.Value=Pr,a.bindConstant=yr,a.bindIntercept=vr,a.bindValue=it,a.cleanAllLocalsContainer=Yt,a.colors=xe,a.configuration=hr,a.constant=Ve,a.controller=g,a.createContainer=$e,a.destroyInjector=Gr,a.detachLocalsContainer=Dt,a.discoverHooks=It,a.getConfiguration=_r,a.getConstructorDependencies=Qt,a.getInterceptorOptions=Xr,a.inject=Nt,a.injectMany=de,a.injectable=i,a.injector=H,a.interceptor=h,a.invokeOptions=gt,a.lazyInject=ve,a.localsContainer=yt,a.mergeMount=Oe,a.optionalLazyInject=We,a.providerBuilder=r,a.refValue=Rr,a.registerProvider=qr,a.setConstructorDependencies=fr,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}(Ee,Ee.exports)),Ee.exports}var _t=dn(),yn=Object.defineProperty,gn=Object.getOwnPropertyDescriptor,Xt=(ft,I,a,$)=>{for(var U=$>1?void 0:$?gn(I,a):I,A=ft.length-1,Q;A>=0;A--)(Q=ft[A])&&(U=($?Q(I,a,U):Q(U))||U);return $&&U&&yn(I,a,U),U};J.EventEmitterModule=class{$onInit(){this.loadEventEmitter&&this.injector.getProviders().forEach(a=>this.bindEventListeners(a))}$onReady(){this.loadEventEmitter?(this.disableSummary||this.printEvents(),this.logger.info("EventEmitter listening...")):this.logger.info("EventEmitter disabled...")}printEvents(){const I=this.eventEmitter.eventNames().map($=>{const U=this.eventEmitter.listenerCount($).toString();return{eventName:$,listenerCount:U}});this.logger.info("EventEmitter events mounted:");const a=this.logger.drawTable(I,{padding:1,header:{eventName:"Event name",listenerCount:"Number of listener"}});this.logger.info(`
23
- `+a.trim())}bindEventListeners(I){this.bindOn(I),this.bindOnAny(I)}getListener(I,a){const $=this.injector.get(I.token);return $[a].bind($)}bindOn(I){const a=I.store.get("eventEmitter");Object.entries((a==null?void 0:a.onEvent)||{}).forEach(([$,{event:U,options:A}])=>{const Q=this.getListener(I,$);this.eventEmitter.on(U,Q,A)})}bindOnAny(I){const a=I.store.get("eventEmitter");Object.keys((a==null?void 0:a.onAny)||{}).forEach($=>{const U=this.getListener(I,$);this.eventEmitter.onAny(U)})}},Xt([_t.Inject(_t.LOGGER)],J.EventEmitterModule.prototype,"logger",2),Xt([_t.Inject()],J.EventEmitterModule.prototype,"injector",2),Xt([_t.Inject()],J.EventEmitterModule.prototype,"eventEmitter",2),Xt([_t.Constant("eventEmitter.disableSummary",!1)],J.EventEmitterModule.prototype,"disableSummary",2),Xt([_t.Constant("eventEmitter.enabled",!1)],J.EventEmitterModule.prototype,"loadEventEmitter",2),J.EventEmitterModule=Xt([_t.Module()],J.EventEmitterModule);const vn=Sr.EventEmitter2;_t.registerProvider({token:Sr.EventEmitter2,deps:[_t.Configuration],useFactory(ft){const I=ft.get("eventEmitter",{enabled:!1});return I.enabled?new Sr.EventEmitter2(I):{}}}),J.EventEmitterService=vn,J.OnAny=ln,J.OnEvent=hn,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})});