plugin-tls 3.5.0 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/TierOptionsPluginHostEventEmitter-BjGVIRN6.cjs +1 -0
  2. package/dist/TierOptionsPluginHostEventEmitter-DXTNpSmS.js +131 -0
  3. package/dist/TierOptionsPluginHostEventTarget-Bok_zzQ1.js +131 -0
  4. package/dist/TierOptionsPluginHostEventTarget-DqfVEP_L.cjs +1 -0
  5. package/dist/decorator-Culqv4k6.js +1454 -0
  6. package/dist/decorator-Wf_x4qDo.cjs +1 -0
  7. package/dist/index-com.d.ts +3 -0
  8. package/dist/index-com.d.ts.map +1 -0
  9. package/dist/index-node.cjs +1 -0
  10. package/dist/index-node.d.ts +4 -0
  11. package/dist/index-node.d.ts.map +1 -0
  12. package/dist/index-node.js +58 -0
  13. package/dist/index-web.cjs +1 -0
  14. package/dist/index-web.d.ts +4 -0
  15. package/dist/index-web.d.ts.map +1 -0
  16. package/dist/index-web.js +58 -0
  17. package/dist/index.cjs +1 -0
  18. package/dist/index.d.ts +5 -4
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +60 -1689
  21. package/dist/options/index-com.d.ts +4 -0
  22. package/dist/options/index-com.d.ts.map +1 -0
  23. package/dist/options/index-node.d.ts +3 -0
  24. package/dist/options/index-node.d.ts.map +1 -0
  25. package/dist/options/index-web.d.ts +3 -0
  26. package/dist/options/index-web.d.ts.map +1 -0
  27. package/dist/options/options-plugin-host/{index.d.ts → index-com.d.ts} +1 -1
  28. package/dist/options/options-plugin-host/index-com.d.ts.map +1 -0
  29. package/dist/options/options-plugin-host/index-node.d.ts +4 -0
  30. package/dist/options/options-plugin-host/index-node.d.ts.map +1 -0
  31. package/dist/options/options-plugin-host/index-web.d.ts +4 -0
  32. package/dist/options/options-plugin-host/index-web.d.ts.map +1 -0
  33. package/dist/options/options-plugin-host/tier-mode-options/TierModeOptionsPluginHost.d.ts +1 -1
  34. package/dist/options/options-plugin-host/tier-mode-options/TierModeOptionsPluginHost.d.ts.map +1 -1
  35. package/dist/options/options-plugin-host/tier-mode-options/TierModeOptionsPluginHostEventEmitter.d.ts +2 -2
  36. package/dist/options/options-plugin-host/tier-mode-options/TierModeOptionsPluginHostEventEmitter.d.ts.map +1 -1
  37. package/dist/options/options-plugin-host/tier-mode-options/TierModeOptionsPluginHostEventTarget.d.ts +1 -1
  38. package/dist/options/options-plugin-host/tier-mode-options/TierModeOptionsPluginHostEventTarget.d.ts.map +1 -1
  39. package/dist/options/options-plugin-host/tier-mode-options/index.d.ts +0 -2
  40. package/dist/options/options-plugin-host/tier-mode-options/index.d.ts.map +1 -1
  41. package/dist/options/options-plugin-host/tier-options/TierOptionsPluginHost.d.ts +1 -1
  42. package/dist/options/options-plugin-host/tier-options/TierOptionsPluginHost.d.ts.map +1 -1
  43. package/dist/options/options-plugin-host/tier-options/TierOptionsPluginHostEventEmitter.d.ts +2 -2
  44. package/dist/options/options-plugin-host/tier-options/TierOptionsPluginHostEventEmitter.d.ts.map +1 -1
  45. package/dist/options/options-plugin-host/tier-options/TierOptionsPluginHostEventTarget.d.ts +1 -1
  46. package/dist/options/options-plugin-host/tier-options/TierOptionsPluginHostEventTarget.d.ts.map +1 -1
  47. package/dist/options/options-plugin-host/tier-options/index.d.ts +0 -2
  48. package/dist/options/options-plugin-host/tier-options/index.d.ts.map +1 -1
  49. package/dist/options/plugins/tier-mode-options/type.d.ts +1 -1
  50. package/dist/options/plugins/tier-mode-options/type.d.ts.map +1 -1
  51. package/dist/options/plugins/tier-options/type.d.ts +1 -1
  52. package/dist/options/plugins/tier-options/type.d.ts.map +1 -1
  53. package/dist/plugin-host/{index.d.ts → index-com.d.ts} +1 -3
  54. package/dist/plugin-host/index-com.d.ts.map +1 -0
  55. package/dist/plugin-host/index-node.d.ts +3 -0
  56. package/dist/plugin-host/index-node.d.ts.map +1 -0
  57. package/dist/plugin-host/index-web.d.ts +3 -0
  58. package/dist/plugin-host/index-web.d.ts.map +1 -0
  59. package/dist/plugin-manager/ExtendManager.d.ts.map +1 -1
  60. package/dist/plugin-manager/IExtend.d.ts +13 -0
  61. package/dist/plugin-manager/IExtend.d.ts.map +1 -1
  62. package/dist/plugin-manager/PluginExtendManager.d.ts.map +1 -1
  63. package/dist/plugin-manager/mixin.d.ts +20 -0
  64. package/dist/plugin-manager/mixin.d.ts.map +1 -1
  65. package/package.json +24 -7
  66. package/dist/index.umd.cjs +0 -1
  67. package/dist/options/index.d.ts +0 -4
  68. package/dist/options/index.d.ts.map +0 -1
  69. package/dist/options/options-plugin-host/index.d.ts.map +0 -1
  70. package/dist/plugin-host/index.d.ts.map +0 -1
package/dist/index.js CHANGED
@@ -1,1691 +1,62 @@
1
- import { Destroyable as M, DestroyableEventEmitter as N, DestroyableEventTarget as H, createDestroyableSubClass as V } from "@gby/destroyable";
2
- import { serialCallFuns as g } from "com-tools";
3
- import { deepmergeInto as P, deepmerge as w } from "deepmerge-ts";
4
- function u(s, ...t) {
5
- for (const e of t) {
6
- const n = Object.getOwnPropertyDescriptors(e);
7
- Object.defineProperties(s, n);
8
- }
9
- return s;
10
- }
11
- function B(s, t) {
12
- return t;
13
- }
14
- function K() {
15
- return function(t) {
16
- return t;
17
- };
18
- }
19
- function R(s, t) {
20
- return u(s, t), t;
21
- }
22
- function W(s) {
23
- return function(e) {
24
- return u(s, e), e;
25
- };
26
- }
27
- function h(s, t) {
28
- return u(s, t), s;
29
- }
30
- function G(s) {
31
- return function(e) {
32
- return u(s, e), s;
33
- };
34
- }
35
- function J(s, t) {
36
- return t;
37
- }
38
- function L() {
39
- return function(t) {
40
- return t;
41
- };
42
- }
43
- function Q(s, t) {
44
- return u(s.prototype, t), t;
45
- }
46
- function X(s) {
47
- return function(e) {
48
- return u(s.prototype, e), e;
49
- };
50
- }
51
- function Y(s, t) {
52
- return u(s.prototype, t), s;
53
- }
54
- function Z(s) {
55
- return function(e) {
56
- return u(s.prototype, e), s;
57
- };
58
- }
59
- const k = ["onCreate", "onInit", "onDestroy"];
60
- function T(s) {
61
- const t = { ...s };
62
- for (const e of k)
63
- typeof t[e] == "function" && delete t[e];
64
- return t;
65
- }
66
- function I(s) {
67
- return s && typeof s.onUse == "function";
68
- }
69
- class tt extends M {
70
- /**
71
- * 插件的宿主
72
- */
73
- host;
74
- /**
75
- * 所有注册的插件
76
- */
77
- plugins = /* @__PURE__ */ new Map();
78
- /**
79
- * @param host - 插件的宿主
80
- */
81
- constructor(t) {
82
- super(), t && (this.host = t);
83
- }
84
- destroyThis() {
85
- return this.plugins.clear(), this.host = null, super.destroyThis();
86
- }
87
- /**
88
- * 是否注册了插件
89
- * @param plugin - 插件
90
- * @returns 是否注册了插件
91
- */
92
- hasUsed(t) {
93
- return this.plugins.has(t);
94
- }
95
- /**
96
- * 使用插件、注册插件
97
- * @param plugin - 插件
98
- * @param args - 传递给插件的选项
99
- */
100
- use(t, ...e) {
101
- const { plugins: n } = this;
102
- if (n.has(t)) return n.get(t);
103
- const i = t.onUse(this.host, ...e);
104
- return n.set(t, i), i;
105
- }
106
- /**
107
- * 插件宿主实例的注册插件的方法
108
- *
109
- * @remarks
110
- * 会调用每个插件的 {@link IPlugin.use } 方法
111
- * @param hostInst - 插件宿主的新实例
112
- */
113
- instUse(t, e, ...n) {
114
- const { plugins: i } = this;
115
- if (i.has(e)) return i.get(e);
116
- const r = this.use(e, ...n);
117
- return e.onCreate?.(t), r;
118
- }
119
- /**
120
- * 插件宿主创建实例时调用
121
- *
122
- * @remarks
123
- * 会调用每个插件的 {@link IPlugin.onCreate} 方法
124
- * 如果插件的 created 方法返回 Promise,则会等待 Promise resolve
125
- * @param hostInst - 插件宿主的新实例
126
- */
127
- onCreate(t, ...e) {
128
- const n = [];
129
- for (const [i] of this.plugins)
130
- i.onCreate && n.push(i.onCreate.bind(i));
131
- return g(n, void 0, [t, ...e]);
132
- }
133
- /**
134
- * 插件宿主创建实例时调用
135
- *
136
- * @remarks
137
- * 会调用每个插件的 {@link IPlugin.onCreate } 方法
138
- * @param hostInst - 插件宿主的新实例
139
- * @param args - 初始化宿主实例时的参数
140
- */
141
- onInit(t, ...e) {
142
- const n = [];
143
- for (const [i] of this.plugins)
144
- i.onInit && n.push(i.onInit.bind(i));
145
- return g(n, void 0, [t, ...e]);
146
- }
147
- /**
148
- * 插件宿主被销毁时调用
149
- *
150
- * @remarks
151
- * 会调用每个插件的 {@link IPlugin.onDestroy} 方法
152
- * @param hostInst - 被销毁的插件实例
153
- */
154
- onDestroy(t) {
155
- const e = [];
156
- for (const [n] of this.plugins)
157
- n.onDestroy && e.push(n.onDestroy.bind(n));
158
- return e.reverse(), g(e, void 0, [t]);
159
- }
160
- }
161
- class et extends M {
162
- /**
163
- * 插件的宿主
164
- */
165
- host;
166
- /**
167
- * 所有注册的插件
168
- */
169
- plugins = /* @__PURE__ */ new Set();
170
- /**
171
- * @param host - 插件的宿主
172
- */
173
- constructor(t) {
174
- super(), t && (this.host = t);
175
- }
176
- destroyThis() {
177
- return this.plugins.clear(), this.host = null, super.destroyThis();
178
- }
179
- /**
180
- * 是否注册了插件
181
- * @param plugin - 插件
182
- * @returns 是否注册了插件
183
- */
184
- hasUsed(t) {
185
- return this.plugins.has(t);
186
- }
187
- /**
188
- * 使用插件、注册插件
189
- * @param plugin - 插件
190
- * @returns 返回插件对象本身
191
- */
192
- use(t) {
193
- const { plugins: e } = this;
194
- return e.has(t) || (u(this.host.prototype, T(t)), e.add(t)), t;
195
- }
196
- /**
197
- * 插件宿主实例的注册插件的方法
198
- *
199
- * @remarks
200
- * 会调用每个插件的 {@link IExtend.use } 方法
201
- * @param hostInst - 插件宿主的新实例
202
- */
203
- instUse(t, e, ...n) {
204
- const { plugins: i } = this;
205
- return i.has(e) || (this.use(e), e.onCreate?.call(t, t, ...n)), e;
206
- }
207
- /**
208
- * 插件宿主创建实例时调用
209
- *
210
- * @remarks
211
- * 会调用每个插件的 {@link IExtend.onCreate} 方法
212
- * 如果插件的 created 方法返回 Promise,则会等待 Promise resolve
213
- * @param hostInst - 插件宿主的新实例
214
- */
215
- onCreate(t, ...e) {
216
- const n = [];
217
- for (const i of this.plugins)
218
- i.onCreate && n.push(i.onCreate);
219
- return g(n, t, [t, ...e]);
220
- }
221
- /**
222
- * 插件宿主创建实例时调用
223
- *
224
- * @remarks
225
- * 会调用每个插件的 {@link IExtend.onCreate } 方法
226
- * @param hostInst - 插件宿主的新实例
227
- * @param args - 初始化宿主实例时的参数
228
- */
229
- onInit(t, ...e) {
230
- const n = [];
231
- for (const i of this.plugins)
232
- i.onInit && n.push(i.onInit);
233
- return g(n, t, [t, ...e]);
234
- }
235
- /**
236
- * 插件宿主被销毁时调用
237
- *
238
- * @remarks
239
- * 会调用每个插件的 {@link IExtend.onDestroy} 方法
240
- * @param hostInst - 被销毁的插件实例
241
- */
242
- onDestroy(t) {
243
- const e = [];
244
- for (const n of this.plugins)
245
- n.onDestroy && e.push(n.onDestroy);
246
- return e.reverse(), g(e, t, [t]);
247
- }
248
- }
249
- const O = /* @__PURE__ */ Symbol("extend");
250
- class d extends M {
251
- /**
252
- * 插件的宿主
253
- */
254
- host;
255
- /**
256
- * 所有注册的插件
257
- */
258
- plugins = /* @__PURE__ */ new Map();
259
- /**
260
- * @param host - 插件的宿主
261
- */
262
- constructor(t) {
263
- super(), t && (this.host = t);
264
- }
265
- destroyThis() {
266
- return this.plugins.clear(), this.host = null, super.destroyThis();
267
- }
268
- /**
269
- * 是否注册了插件 或 扩展
270
- * @param plugin - 插件 或 扩展
271
- * @returns 是否注册了插件 或 扩展
272
- */
273
- hasUsed(t) {
274
- return this.plugins.has(t);
275
- }
276
- /**
277
- * 判断一个对象是否是插件
278
- * @param target
279
- * @returns
280
- */
281
- isPlugin(t) {
282
- const { plugins: e } = this;
283
- return e.has(t) ? e.get(t) !== O : I(t);
284
- }
285
- /**
286
- * 使用插件、注册插件
287
- * @param ext - 插件
288
- * @param args - 传递给插件的选项
289
- */
290
- useExtend(t) {
291
- const { plugins: e } = this;
292
- return e.has(t) ? e.get(t) : (u(this.host.prototype, T(t)), e.set(t, O), t);
293
- }
294
- /**
295
- * 插件宿主实例的注册插件的方法
296
- *
297
- * @remarks
298
- * 会调用每个插件的 {@link IExtend.use } 方法
299
- * @param hostInst - 插件宿主的新实例
300
- */
301
- instUseExtend(t, e, ...n) {
302
- const { plugins: i } = this;
303
- return i.has(e) ? i.get(e) : (this.useExtend(e), e.onCreate?.call(t, t, ...n), e);
304
- }
305
- /**
306
- * 使用插件、注册插件
307
- * @param plugin - 插件
308
- * @param args - 传递给插件的选项
309
- */
310
- usePlugin(t, ...e) {
311
- const { plugins: n } = this;
312
- if (n.has(t)) return n.get(t);
313
- const i = t.onUse(this.host, ...e);
314
- return n.set(t, i), i;
315
- }
316
- /**
317
- * 插件宿主实例的注册插件的方法
318
- *
319
- * @remarks
320
- * 会调用每个插件的 {@link IPlugin.use } 方法
321
- * @param hostInst - 插件宿主的新实例
322
- */
323
- instUsePlugin(t, e, ...n) {
324
- const { plugins: i } = this;
325
- if (i.has(e)) return i.get(e);
326
- const r = this.usePlugin(e, ...n);
327
- return e.onCreate?.(t), r;
328
- }
329
- /**
330
- * 插件宿主创建实例时调用
331
- *
332
- * @remarks
333
- * 会调用每个插件的 {@link IPlugin.onCreate} 方法
334
- * 如果插件的 created 方法返回 Promise,则会等待 Promise resolve
335
- * @param hostInst - 插件宿主的新实例
336
- */
337
- onCreate(t, ...e) {
338
- const n = [];
339
- for (const [i, r] of this.plugins)
340
- if (i.onCreate) {
341
- const o = r === O ? i.onCreate : i.onCreate.bind(i);
342
- n.push(o);
343
- }
344
- return g(n, t, [t, ...e]);
345
- }
346
- /**
347
- * 插件宿主创建实例时调用
348
- *
349
- * @remarks
350
- * 会调用每个插件的 {@link IPlugin.onCreate } 方法
351
- * @param hostInst - 插件宿主的新实例
352
- * @param args - 初始化宿主实例时的参数
353
- */
354
- onInit(t, ...e) {
355
- const n = [];
356
- for (const [i, r] of this.plugins)
357
- if (i.onInit) {
358
- const o = r === O ? i.onInit : i.onInit.bind(i);
359
- n.push(o);
360
- }
361
- return g(n, t, [t, ...e]);
362
- }
363
- /**
364
- * 插件宿主被销毁时调用
365
- *
366
- * @remarks
367
- * 会调用每个插件的 {@link IPlugin.onDestroy} 方法
368
- * @param hostInst - 被销毁的插件实例
369
- */
370
- onDestroy(t) {
371
- const e = [];
372
- for (const [n, i] of this.plugins)
373
- if (n.onDestroy) {
374
- const r = i === O ? n.onDestroy : n.onDestroy.bind(n);
375
- e.push(r);
376
- }
377
- return e.reverse(), g(e, t, [t]);
378
- }
379
- }
380
- function nt(s, t) {
381
- const e = t ?? "defaultOptions", n = `_${e}`;
382
- return function(r) {
383
- const o = h(r, {
384
- /**
385
- * 全局级别的默认选项
386
- */
387
- get [e]() {
388
- return s;
389
- }
390
- });
391
- h(o.prototype, {
392
- /**
393
- * 实例级的默认选项
394
- */
395
- get [e]() {
396
- return this[n] || (this[n] = structuredClone(o.defaultOptions));
397
- }
398
- });
399
- };
400
- }
401
- function st(s, t, e) {
402
- const n = `_${t}`;
403
- return h(s.prototype, {
404
- /**
405
- * 实例级的默认选项
406
- */
407
- get [t]() {
408
- return this[n] || (this[n] = structuredClone(s[t]));
409
- }
410
- }), e;
411
- }
412
- function E(s) {
413
- const t = s.split(".");
414
- return t[0] === "" && t.shift(), t;
415
- }
416
- function y(s, t) {
417
- for (const e of t)
418
- if (s = s[e], s == null) return;
419
- return s;
420
- }
421
- function it(s, t) {
422
- return y(s, E(t));
423
- }
424
- function U(s, t, e) {
425
- const n = t.pop(), i = t.length;
426
- let r = 0;
427
- for (; r < i; ) {
428
- const o = s[t[r]];
429
- if (o == null) break;
430
- s = o, r++;
431
- }
432
- t = t.slice(r);
433
- for (const o of t)
434
- s = s[o] = {};
435
- return s[n] = e, s;
436
- }
437
- function rt(s, t, e) {
438
- return U(s, E(t), e);
439
- }
440
- const x = {
441
- UndefinedAndNull: function(t) {
442
- return t == null;
443
- },
444
- Undefined: function(t) {
445
- return t === void 0;
446
- },
447
- Null: function(t) {
448
- return t === null;
449
- }
450
- };
451
- class b {
452
- /**
453
- * 是否要冻结 fullOption 的成员
454
- * @remarks
455
- * 只会冻结 fullOption 的直接成员的值,不会冻结 fullOption 孙子成员的值
456
- */
457
- freezeMember = !0;
458
- /**
459
- * 可更新顶级成员值的完整的选项
460
- * @remarks
461
- * 合并后的选项;
462
- * plainFullOption 的代理对象,自动监听了顶层成员的屐;所以可以更改顶级成员的值,不可以更改非顶级成员的值;
463
- */
464
- fullOption = new Proxy(this, {
465
- // @ts-ignore
466
- get: function(t, e, n) {
467
- const i = t.plainFullOption[e];
468
- return t.freezeMember ? Object.freeze(i) : i;
469
- },
470
- // @ts-ignore
471
- set: function(t, e, n, i) {
472
- return t.setMember(e, n, !1), !0;
473
- },
474
- // @ts-ignore
475
- has: function(t, e) {
476
- return e in t.plainFullOption;
477
- },
478
- // @ts-ignore
479
- getOwnPropertyDescriptor: function(t, e) {
480
- return Object.getOwnPropertyDescriptor(t.plainFullOption, e);
481
- },
482
- // @ts-ignore
483
- ownKeys: function(t) {
484
- return Reflect.ownKeys(t.plainFullOption);
485
- },
486
- // @ts-ignore
487
- deleteProperty: function(t, e) {
488
- return t.setMember(e, void 0), !0;
489
- },
490
- // @ts-ignore
491
- defineProperty: function(t, e, n) {
492
- return Object.defineProperty(t.option, e, n), !0;
493
- }
494
- });
495
- /**
496
- * 设置选项
497
- * @remarks
498
- * 会将被设置的选项浅合并进当前选项中
499
- * @param option
500
- * @param deep - 是否要进行深度合并
501
- */
502
- setOption(t, e) {
503
- const n = e ? P(this.option, t) : Object.assign(this.option, t);
504
- return this.updateFullOption(), n;
505
- }
506
- /**
507
- * 未定义值的类型
508
- */
509
- get undefinedValue() {
510
- return this._undefinedValue;
511
- }
512
- set undefinedValue(t) {
513
- this._undefinedValue = t, this.isUndefined = x[t] || x.UndefinedAndNull;
514
- }
515
- _undefinedValue = "UndefinedAndNull";
516
- /**
517
- * 未定义值的判断函数
518
- */
519
- isUndefined = x.UndefinedAndNull;
520
- /**
521
- * 获取选项成员
522
- * @param key
523
- * @returns
524
- */
525
- getMember(t) {
526
- return this.option[t];
527
- }
528
- /**
529
- * 设置选项成员
530
- * @param key
531
- * @param value
532
- * @param deep - 是否要进行深度合并
533
- */
534
- setMember(t, e, n) {
535
- const i = this.option;
536
- if (e === void 0)
537
- delete i[t];
538
- else {
539
- const r = i[t];
540
- n && r && typeof r == "object" ? P(r, e) : i[t] = e;
541
- }
542
- this.updateFullOption();
543
- }
544
- /**
545
- * 获取属性路径对应的值
546
- * @param propPath
547
- * @returns
548
- */
549
- getValue(t) {
550
- return y(this.option, t);
551
- }
552
- /**
553
- * 设置属性路径对应的值
554
- * @param propPath
555
- * @param value
556
- * @param deep - 是否要进行深度合并
557
- * @returns
558
- */
559
- setValue(t, e, n) {
560
- const i = this.option;
561
- let r;
562
- n && (r = y(i, t)) && typeof r == "object" ? P(r, e) : U(this.option, t, e), this.updateFullOption();
563
- }
564
- }
565
- class a extends b {
566
- constructor(t, e) {
567
- super(), t && (this.option = t), e && (this.extends = e);
568
- }
569
- /**
570
- * 继承的选项
571
- */
572
- get extends() {
573
- return this._extends;
574
- }
575
- set extends(t) {
576
- this._extends = t, this.updateFullOption();
577
- }
578
- _extends = null;
579
- /**
580
- * 选项
581
- */
582
- option = {};
583
- /**
584
- * 获取完整的选项
585
- * @remarks
586
- * 会与继承来的选项进行合并
587
- */
588
- get plainFullOption() {
589
- let t = this._plainFullOption;
590
- if (t) return t;
591
- const { extends: e, option: n } = this;
592
- if (t = n, e) {
593
- const i = e.plainFullOption;
594
- t = w(i, n);
595
- }
596
- return this._plainFullOption = t;
597
- }
598
- _plainFullOption = null;
599
- /**
600
- * 更新
601
- */
602
- updateFullOption() {
603
- this._plainFullOption = null;
604
- }
605
- /**
606
- * 获取选项成员
607
- * @param key
608
- * @returns
609
- */
610
- getMember(t) {
611
- const e = this.option[t];
612
- if (!this.isUndefined(e)) return e;
613
- const n = this.extends;
614
- if (n)
615
- return n.getMember(t);
616
- }
617
- /**
618
- * 获取属性路径对应的值
619
- * @param propPath
620
- * @returns
621
- */
622
- getValue(t) {
623
- const e = super.getValue(t);
624
- if (!this.isUndefined(e)) return e;
625
- const n = this.extends;
626
- if (n)
627
- return n.getValue(t);
628
- }
629
- }
630
- function ot(s, t) {
631
- const { name: e } = t, n = `_${e}`;
632
- return {
633
- get: function() {
634
- return this[n] || (this[n] = new a(void 0, this.constructor[e]));
635
- }
636
- };
637
- }
638
- class S extends b {
639
- constructor(t, e) {
640
- super(), e && this.setModeOption(t, e), this.mode = t;
641
- }
642
- /**
643
- * 模式的配置
644
- */
645
- modes = {};
646
- /**
647
- * 当前模式
648
- */
649
- get mode() {
650
- return this._mode || (this.mode = this.modeNames[0]);
651
- }
652
- set mode(t) {
653
- this._mode = t, this.hasMode(t) || this.setModeOption(t, {}), this.updateFullOption();
654
- }
655
- _mode;
656
- /**
657
- * 所有的模式名字
658
- */
659
- get modeNames() {
660
- return this._modeNames || (this._modeNames = this.getModeNames());
661
- }
662
- _modeNames = null;
663
- /**
664
- * 获取所有的模式名字
665
- * @returns
666
- */
667
- getModeNames() {
668
- return Object.keys(this.modes);
669
- }
670
- /**
671
- * 判断是否有某个模式
672
- * @param mode
673
- * @returns
674
- */
675
- hasMode(t) {
676
- return !!this.modes[t];
677
- }
678
- /**
679
- * 当前模式的选项
680
- */
681
- get optionManager() {
682
- return this.modes[this.mode];
683
- }
684
- /**
685
- * 当前模式对应的选项
686
- */
687
- get option() {
688
- return this.optionManager.option;
689
- }
690
- get plainFullOption() {
691
- return this._plainFullOption ?? (this._plainFullOption = this.getFullModeOption(this.mode));
692
- }
693
- _plainFullOption = null;
694
- /**
695
- * 更新
696
- */
697
- updateFullOption() {
698
- this._plainFullOption = null, this._modeNames = null;
699
- }
700
- /**
701
- * 返回已合并继承选项的选项
702
- * @remarks
703
- * 与继承选项只是浅合并
704
- * @param mode
705
- * @returns
706
- */
707
- getModeOption(t) {
708
- return this.modes[t].option;
709
- }
710
- /**
711
- * 返回已合并继承选项的完整选项
712
- * @remarks
713
- * 与继承选项合并
714
- * @param mode
715
- * @returns
716
- */
717
- getFullModeOption(t) {
718
- return this.modes[t]?.plainFullOption;
719
- }
720
- /**
721
- * 给模式设置选项
722
- * @param mode
723
- * @param option
724
- * @param deep - 是否要进行深度合并
725
- * @param extend - 继承哪个模式
726
- */
727
- setModeOption(t, e, n, i) {
728
- const { modes: r } = this, o = r[t] || (r[t] = new a());
729
- if (o.setOption(e, n), i) {
730
- const p = r[i];
731
- p && (o.extends = p);
732
- }
733
- return this.updateFullOption(), o;
734
- }
735
- }
736
- class l extends S {
737
- constructor(t, e, n) {
738
- super(t, e), n && (this.extends = n);
739
- }
740
- /**
741
- * 继承的选项
742
- */
743
- get extends() {
744
- return this._extends;
745
- }
746
- set extends(t) {
747
- this._extends = t, this.updateFullOption();
748
- }
749
- _extends = null;
750
- /**
751
- * 返回已合并继承选项的最终选项
752
- * @remarks
753
- * 与继承选项只是浅合并
754
- * @param mode
755
- * @returns
756
- */
757
- getFullModeOption(t) {
758
- const { modes: e, extends: n } = this, i = e[t]?.plainFullOption;
759
- if (n) {
760
- const r = n.getFullModeOption(t);
761
- return i ? w(r, i) : r;
762
- }
763
- return i;
764
- }
765
- /**
766
- * 获取所有的模式名字
767
- * @returns
768
- */
769
- getModeNames() {
770
- const { modes: t, extends: e } = this, n = Object.keys(t);
771
- if (!e) return n;
772
- const i = e.getModeNames();
773
- return [.../* @__PURE__ */ new Set([...n, ...i])];
774
- }
775
- /**
776
- * 在整个层级上判断是否有某个模式
777
- * @param mode
778
- * @returns
779
- */
780
- hasModeOnTier(t) {
781
- if (this.hasMode(t)) return !0;
782
- const e = this.extends;
783
- return e ? e.hasModeOnTier(t) : !1;
784
- }
785
- /**
786
- * 当前模式的选项
787
- */
788
- get optionManager() {
789
- return this.getModeOptionManager(this.mode);
790
- }
791
- /**
792
- * 获取模式对应的选项管理器
793
- * @param mode
794
- * @returns
795
- */
796
- getModeOptionManager(t) {
797
- const e = this.modes[t];
798
- return e || (this.extends?.getModeOptionManager(t) ? this.setModeOption(t, {}) : null);
799
- }
800
- /**
801
- * 获取选项成员
802
- * @param key
803
- * @returns
804
- */
805
- getMember(t) {
806
- const e = this.optionManager.getMember(t);
807
- if (!this.isUndefined(e)) return e;
808
- const n = this.extends;
809
- if (n)
810
- return n.getMember(t);
811
- }
812
- /**
813
- * 获取属性路径对应的值
814
- * @param propPath
815
- * @returns
816
- */
817
- getValue(t) {
818
- const e = this.optionManager.getValue(t);
819
- if (!this.isUndefined(e)) return e;
820
- const n = this.extends;
821
- if (n)
822
- return n.getValue(t);
823
- }
824
- }
825
- function ut(s, t) {
826
- const { name: e } = t, n = `_${e}`;
827
- return {
828
- get: function() {
829
- return this[n] || (this[n] = new l(this.constructor[e].mode, void 0, this.constructor[e]));
830
- }
831
- };
832
- }
833
- class v extends M {
834
- /**
835
- * 是否使用独立的插件管理器
836
- * @defaultValue false
837
- */
838
- static isolatedPluginManager = !1;
839
- /**
840
- * 插件管理器
841
- */
842
- static get pluginManager() {
843
- return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new d(this)), this._pluginManager;
844
- }
845
- static _pluginManager = new d(this);
846
- /**
847
- * 插件管理器 {@link PluginHost.pluginManager}
848
- */
849
- get pluginManager() {
850
- return this.constructor.pluginManager;
851
- }
852
- /**
853
- * {@inheritDoc PluginExtendManager.usePlugin}
854
- */
855
- static usePlugin(t, ...e) {
856
- return this.pluginManager.usePlugin(t, ...e);
857
- }
858
- /**
859
- * {@inheritDoc PluginExtendManager.useExtend}
860
- */
861
- static useExtend(t) {
862
- return this.pluginManager.useExtend(t);
863
- }
864
- /**
865
- * 是否注册了插件 或 扩展
866
- * @param plugin - 插件 或 扩展
867
- * @returns 是否注册了插件 或 扩展
868
- */
869
- static hasUsed(t) {
870
- return this.pluginManager.hasUsed(t);
871
- }
872
- /**
873
- * 需要在子类中调用
874
- *
875
- * 之所以没写在该类中的函数中,是因为 `this.pluginManager.onCreate(this,...args)` 通常会在构建函数执行的最后时才调用;
876
- * 如果像下面写在该类的构建函数中,然后子类通过 `super()` 来调用,这样就会导致 `this.pluginManager.onCreate(this,...args)` 不是在最后的执行;
877
- */
878
- // constructor(...args:any) {
879
- // super();
880
- // // @ts-ignore
881
- // this.pluginManager.onCreate(this,...args);
882
- // }
883
- /**
884
- * 实例的注册插件的方法
885
- * @param plugin
886
- * @param args
887
- * @returns
888
- */
889
- usePlugin(t, ...e) {
890
- return this.pluginManager.instUsePlugin(this, t, ...e);
891
- }
892
- /**
893
- * {@inheritDoc PluginExtendManager.useExtend}
894
- */
895
- useExtend(t, ...e) {
896
- return this.pluginManager.instUseExtend(this, t, ...e);
897
- }
898
- /**
899
- * 初始化实例
900
- * @remarks
901
- * 会调用 {@link PluginExtendManager.onInit}
902
- * @param args
903
- */
904
- init(...t) {
905
- return this.pluginManager.onInit(this, ...t);
906
- }
907
- /**
908
- * 销毁实例
909
- * @returns
910
- */
911
- destroyThis() {
912
- const t = this.pluginManager.onDestroy(this);
913
- return t instanceof Promise ? t.finally(() => super.destroyThis()) : super.destroyThis();
914
- }
915
- }
916
- class F extends N {
917
- /**
918
- * 是否使用独立的插件管理器
919
- * @defaultValue false
920
- */
921
- static isolatedPluginManager = !1;
922
- /**
923
- * 插件管理器
924
- */
925
- static get pluginManager() {
926
- return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new d(this)), this._pluginManager;
927
- }
928
- static _pluginManager = new d(this);
929
- /**
930
- * 插件管理器 {@link PluginHost.pluginManager}
931
- */
932
- get pluginManager() {
933
- return this.constructor.pluginManager;
934
- }
935
- /**
936
- * {@inheritDoc PluginExtendManager.usePlugin}
937
- */
938
- static usePlugin(t, ...e) {
939
- return this.pluginManager.usePlugin(t, ...e);
940
- }
941
- /**
942
- * {@inheritDoc PluginExtendManager.useExtend}
943
- */
944
- static useExtend(t) {
945
- return this.pluginManager.useExtend(t);
946
- }
947
- /**
948
- * 是否注册了插件 或 扩展
949
- * @param plugin - 插件 或 扩展
950
- * @returns 是否注册了插件 或 扩展
951
- */
952
- static hasUsed(t) {
953
- return this.pluginManager.hasUsed(t);
954
- }
955
- /**
956
- * 需要在子类中调用
957
- *
958
- * 之所以没写在该类中的函数中,是因为 `this.pluginManager.onCreate(this,...args)` 通常会在构建函数执行的最后时才调用;
959
- * 如果像下面写在该类的构建函数中,然后子类通过 `super()` 来调用,这样就会导致 `this.pluginManager.onCreate(this,...args)` 不是在最后的执行;
960
- */
961
- // constructor(...args:any) {
962
- // super();
963
- // // @ts-ignore
964
- // this.pluginManager.onCreate(this,...args);
965
- // }
966
- /**
967
- * 实例的注册插件的方法
968
- * @param plugin
969
- * @param args
970
- * @returns
971
- */
972
- usePlugin(t, ...e) {
973
- return this.pluginManager.instUsePlugin(this, t, ...e);
974
- }
975
- /**
976
- * {@inheritDoc PluginExtendManager.useExtend}
977
- */
978
- useExtend(t, ...e) {
979
- return this.pluginManager.instUseExtend(this, t, ...e);
980
- }
981
- /**
982
- * 初始化实例
983
- * @remarks
984
- * 会调用 {@link PluginExtendManager.onInit}
985
- * @param args
986
- */
987
- init(...t) {
988
- return this.pluginManager.onInit(this, ...t);
989
- }
990
- /**
991
- * 销毁实例
992
- * @returns
993
- */
994
- destroyThis() {
995
- const t = this.pluginManager.onDestroy(this);
996
- return t instanceof Promise ? t.finally(() => super.destroyThis()) : super.destroyThis();
997
- }
998
- }
999
- class D extends H {
1000
- /**
1001
- * 是否使用独立的插件管理器
1002
- * @defaultValue false
1003
- */
1004
- static isolatedPluginManager = !1;
1005
- /**
1006
- * 插件管理器
1007
- */
1008
- static get pluginManager() {
1009
- return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new d(this)), this._pluginManager;
1010
- }
1011
- static _pluginManager = new d(this);
1012
- /**
1013
- * 插件管理器 {@link PluginHost.pluginManager}
1014
- */
1015
- get pluginManager() {
1016
- return this.constructor.pluginManager;
1017
- }
1018
- /**
1019
- * {@inheritDoc PluginExtendManager.usePlugin}
1020
- */
1021
- static usePlugin(t, ...e) {
1022
- return this.pluginManager.usePlugin(t, ...e);
1023
- }
1024
- /**
1025
- * {@inheritDoc PluginExtendManager.useExtend}
1026
- */
1027
- static useExtend(t) {
1028
- return this.pluginManager.useExtend(t);
1029
- }
1030
- /**
1031
- * 是否注册了插件 或 扩展
1032
- * @param plugin - 插件 或 扩展
1033
- * @returns 是否注册了插件 或 扩展
1034
- */
1035
- static hasUsed(t) {
1036
- return this.pluginManager.hasUsed(t);
1037
- }
1038
- /**
1039
- * 需要在子类中调用
1040
- *
1041
- * 之所以没写在该类中的函数中,是因为 `this.pluginManager.onCreate(this,...args)` 通常会在构建函数执行的最后时才调用;
1042
- * 如果像下面写在该类的构建函数中,然后子类通过 `super()` 来调用,这样就会导致 `this.pluginManager.onCreate(this,...args)` 不是在最后的执行;
1043
- */
1044
- // constructor(...args:any) {
1045
- // super();
1046
- // // @ts-ignore
1047
- // this.pluginManager.onCreate(this,...args);
1048
- // }
1049
- /**
1050
- * 实例的注册插件的方法
1051
- * @param plugin
1052
- * @param args
1053
- * @returns
1054
- */
1055
- usePlugin(t, ...e) {
1056
- return this.pluginManager.instUsePlugin(this, t, ...e);
1057
- }
1058
- /**
1059
- * {@inheritDoc PluginExtendManager.useExtend}
1060
- */
1061
- useExtend(t, ...e) {
1062
- return this.pluginManager.instUseExtend(this, t, ...e);
1063
- }
1064
- /**
1065
- * 初始化实例
1066
- * @remarks
1067
- * 会调用 {@link PluginExtendManager.onInit}
1068
- * @param args
1069
- */
1070
- init(...t) {
1071
- return this.pluginManager.onInit(this, ...t);
1072
- }
1073
- /**
1074
- * 销毁实例
1075
- * @returns
1076
- */
1077
- destroyThis() {
1078
- const t = this.pluginManager.onDestroy(this);
1079
- return t instanceof Promise ? t.finally(() => super.destroyThis()) : super.destroyThis();
1080
- }
1081
- }
1082
- function C(s) {
1083
- const t = V(s);
1084
- return class extends t {
1085
- /**
1086
- * 是否使用独立的插件管理器
1087
- * @defaultValue false
1088
- */
1089
- static isolatedPluginManager = !1;
1090
- /**
1091
- * 插件管理器
1092
- */
1093
- static get pluginManager() {
1094
- return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new d(this)), this._pluginManager;
1095
- }
1096
- static _pluginManager = new d(this);
1097
- /**
1098
- * 插件管理器 {@link PluginHostSub.pluginManager}
1099
- */
1100
- get pluginManager() {
1101
- return this.constructor.pluginManager;
1102
- }
1103
- /**
1104
- * {@inheritDoc PluginExtendManager.usePlugin}
1105
- */
1106
- static usePlugin(n, ...i) {
1107
- return this.pluginManager.usePlugin(n, ...i);
1108
- }
1109
- /**
1110
- * {@inheritDoc PluginExtendManager.useExtend}
1111
- */
1112
- static useExtend(n) {
1113
- return this.pluginManager.useExtend(n);
1114
- }
1115
- /**
1116
- * 是否注册了插件 或 扩展
1117
- * @param plugin - 插件 或 扩展
1118
- * @returns 是否注册了插件 或 扩展
1119
- */
1120
- static hasUsed(n) {
1121
- return this.pluginManager.hasUsed(n);
1122
- }
1123
- /**
1124
- * 需要在子类中调用
1125
- *
1126
- * 之所以没写在该类中的函数中,是因为 `this.pluginManager.onCreate(this)` 通常会在构建函数执行的最后时才调用;
1127
- * 如果像下面写在该类的构建函数中,然后子类通过 `super()` 来调用,这样就会导致 `this.pluginManager.onCreate(this)` 不是在最后的执行;
1128
- */
1129
- // constructor() {
1130
- // super();
1131
- // this.pluginManager.onCreate(this);
1132
- // }
1133
- /**
1134
- * 实例的注册插件的方法
1135
- * @param plugin
1136
- * @param args
1137
- * @returns
1138
- */
1139
- usePlugin(n, ...i) {
1140
- return this.pluginManager.instUsePlugin(this, n, ...i);
1141
- }
1142
- /**
1143
- * {@inheritDoc PluginExtendManager.useExtend}
1144
- */
1145
- useExtend(n, ...i) {
1146
- return this.pluginManager.instUseExtend(this, n, ...i);
1147
- }
1148
- /**
1149
- * 初始化实例
1150
- * @remarks
1151
- * 会调用 {@link PluginExtendManager.onInit}
1152
- * @param args
1153
- */
1154
- init(...n) {
1155
- return this.pluginManager.onInit(this, ...n);
1156
- }
1157
- /**
1158
- * 销毁实例
1159
- * @returns
1160
- */
1161
- destroyThis() {
1162
- const n = this.pluginManager.onDestroy(this);
1163
- return n instanceof Promise ? n.finally(() => super.destroyThis()) : super.destroyThis();
1164
- }
1165
- };
1166
- }
1167
- function j(s) {
1168
- const t = h(s, {
1169
- /**
1170
- * 是否使用独立的插件管理器
1171
- * @defaultValue false
1172
- */
1173
- isolatedPluginManager: !1,
1174
- /**
1175
- * PluginHost 的插件管理器
1176
- */
1177
- get pluginManager() {
1178
- return (!this._pluginManager || this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager")) && (this._pluginManager = new d(this)), this._pluginManager;
1179
- },
1180
- // _pluginManager: PluginManager<HOST,Plugin>;
1181
- /**
1182
- * {@inheritDoc PluginExtendManager.usePlugin}
1183
- */
1184
- usePlugin(e, ...n) {
1185
- return this.pluginManager.usePlugin(e, ...n);
1186
- },
1187
- /**
1188
- * {@inheritDoc PluginExtendManager.useExtend}
1189
- */
1190
- useExtend(e) {
1191
- return this.pluginManager.useExtend(e);
1192
- },
1193
- /**
1194
- * 是否注册了插件 或 扩展
1195
- * @param plugin - 插件 或 扩展
1196
- * @returns 是否注册了插件 或 扩展
1197
- */
1198
- hasUsed(e) {
1199
- return this.pluginManager.hasUsed(e);
1200
- }
1201
- });
1202
- return h(t.prototype, {
1203
- /**
1204
- * 插件管理器
1205
- */
1206
- get pluginManager() {
1207
- return this.constructor.pluginManager;
1208
- },
1209
- /**
1210
- * 实例的注册插件的方法
1211
- * @param plugin
1212
- * @param options
1213
- * @returns
1214
- */
1215
- usePlugin(e, ...n) {
1216
- return this.pluginManager.instUsePlugin(this, e, ...n);
1217
- },
1218
- /**
1219
- * {@inheritDoc PluginExtendManager.useExtend}
1220
- */
1221
- useExtend(e, ...n) {
1222
- return this.pluginManager.instUseExtend(this, e, ...n);
1223
- },
1224
- /**
1225
- * 初始化实例
1226
- * @param args
1227
- */
1228
- async init(...e) {
1229
- return super.init && await super.init(...e), this.pluginManager.onInit(this, ...e);
1230
- },
1231
- /**
1232
- * 销毁实例
1233
- * @returns
1234
- */
1235
- async destroy() {
1236
- if (await this.pluginManager.onDestroy(this), super.destroy) return super.destroy();
1237
- }
1238
- }), s;
1239
- }
1240
- function lt(s) {
1241
- const t = j(s);
1242
- return new Proxy(t, {
1243
- construct: function(e, n, i) {
1244
- const r = new e(...n);
1245
- return t.pluginManager.onCreate(this, ...n), r;
1246
- }
1247
- });
1248
- }
1249
- function dt(s) {
1250
- return class extends s {
1251
- /**
1252
- * 是否使用独立的插件管理器
1253
- * @defaultValue false
1254
- */
1255
- static isolatedPluginManager = !1;
1256
- /**
1257
- * 插件管理器
1258
- */
1259
- static get pluginManager() {
1260
- return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new d(this)), this._pluginManager;
1261
- }
1262
- static _pluginManager = new d(this);
1263
- /**
1264
- * 插件管理器 {@link PluginHostExtends.pluginManager}
1265
- */
1266
- get pluginManager() {
1267
- return this.constructor.pluginManager;
1268
- }
1269
- /**
1270
- * {@inheritDoc PluginExtendManager.usePlugin}
1271
- */
1272
- static usePlugin(e, ...n) {
1273
- return this.pluginManager.usePlugin(e, ...n);
1274
- }
1275
- /**
1276
- * {@inheritDoc PluginExtendManager.useExtend}
1277
- */
1278
- static useExtend(e) {
1279
- return this.pluginManager.useExtend(e);
1280
- }
1281
- /**
1282
- * 是否注册了插件 或 扩展
1283
- * @param plugin - 插件 或 扩展
1284
- * @returns 是否注册了插件 或 扩展
1285
- */
1286
- static hasUsed(e) {
1287
- return this.pluginManager.hasUsed(e);
1288
- }
1289
- constructor(...e) {
1290
- super(...e), this.pluginManager.onCreate(this, ...e);
1291
- }
1292
- /**
1293
- * 实例的注册插件的方法
1294
- * @param plugin
1295
- * @param args
1296
- * @returns
1297
- */
1298
- usePlugin(e, ...n) {
1299
- return this.pluginManager.instUsePlugin(this, e, ...n);
1300
- }
1301
- /**
1302
- * {@inheritDoc PluginExtendManager.useExtend}
1303
- */
1304
- useExtend(e, ...n) {
1305
- return this.pluginManager.instUseExtend(this, e, ...n);
1306
- }
1307
- /**
1308
- * 初始化实例
1309
- * @remarks
1310
- * 会调用 {@link PluginExtendManager.onInit}
1311
- * @param args
1312
- */
1313
- init(...e) {
1314
- if (super.init) {
1315
- const n = super.init(...e);
1316
- if (n instanceof Promise)
1317
- return n.then(() => this.pluginManager.onInit(this, ...e));
1318
- }
1319
- return this.pluginManager.onInit(this, ...e);
1320
- }
1321
- /**
1322
- * 销毁实例
1323
- * @returns
1324
- */
1325
- destroy() {
1326
- const e = this.pluginManager.onDestroy(this);
1327
- return super.destroy ? e instanceof Promise ? e.finally(() => super.destroy()) : super.destroy() : e;
1328
- }
1329
- };
1330
- }
1331
- class gt extends v {
1332
- /**
1333
- * 全局级别的默认选项
1334
- */
1335
- static defaultOptions = new a();
1336
- /**
1337
- * 实例级的默认选项
1338
- */
1339
- get defaultOptions() {
1340
- return this._defaultOptions || (this._defaultOptions = new a(void 0, this.constructor.defaultOptions));
1341
- }
1342
- _defaultOptions;
1343
- constructor(t) {
1344
- super(), this.defaultOptions.option = t;
1345
- }
1346
- }
1347
- class ht extends F {
1348
- /**
1349
- * 全局级别的默认选项
1350
- */
1351
- static defaultOptions = new a();
1352
- /**
1353
- * 实例级的默认选项
1354
- */
1355
- get defaultOptions() {
1356
- return this._defaultOptions || (this._defaultOptions = new a(void 0, this.constructor.defaultOptions));
1357
- }
1358
- _defaultOptions;
1359
- constructor(t) {
1360
- super(), this.defaultOptions.option = t;
1361
- }
1362
- }
1363
- class ct extends D {
1364
- /**
1365
- * 全局级别的默认选项
1366
- */
1367
- static defaultOptions = new a();
1368
- /**
1369
- * 实例级的默认选项
1370
- */
1371
- get defaultOptions() {
1372
- return this._defaultOptions || (this._defaultOptions = new a(void 0, this.constructor.defaultOptions));
1373
- }
1374
- _defaultOptions;
1375
- constructor(t) {
1376
- super(), this.defaultOptions.option = t;
1377
- }
1378
- }
1379
- function Ot(s) {
1380
- const t = C(s);
1381
- return class extends t {
1382
- /**
1383
- * 全局级别的默认选项
1384
- */
1385
- static defaultOptions = new a();
1386
- /**
1387
- * 实例级的默认选项
1388
- */
1389
- get defaultOptions() {
1390
- return this._defaultOptions || (this._defaultOptions = new a(void 0, this.constructor.defaultOptions));
1391
- }
1392
- _defaultOptions;
1393
- constructor(n) {
1394
- super(), this.defaultOptions.option = n;
1395
- }
1396
- };
1397
- }
1398
- const c = "common";
1399
- class mt extends v {
1400
- /**
1401
- * 全局级别的默认选项
1402
- */
1403
- static modeOptions = new l(c);
1404
- /**
1405
- * 实例级的默认选项
1406
- */
1407
- get modeOptions() {
1408
- return this._modeOptions || (this._modeOptions = new l(c, void 0, this.constructor.modeOptions));
1409
- }
1410
- _modeOptions;
1411
- get mode() {
1412
- return this.modeOptions.mode;
1413
- }
1414
- set mode(t) {
1415
- this.modeOptions.mode = t;
1416
- }
1417
- get options() {
1418
- return this.modeOptions.plainFullOption;
1419
- }
1420
- constructor(t) {
1421
- super(), this.modeOptions.setOption(t);
1422
- }
1423
- }
1424
- class Mt extends F {
1425
- /**
1426
- * 全局级别的默认选项
1427
- */
1428
- static modeOptions = new l(c);
1429
- /**
1430
- * 实例级的默认选项
1431
- */
1432
- get modeOptions() {
1433
- return this._modeOptions || (this._modeOptions = new l(c, void 0, this.constructor.modeOptions));
1434
- }
1435
- _modeOptions;
1436
- get mode() {
1437
- return this.modeOptions.mode;
1438
- }
1439
- set mode(t) {
1440
- this.modeOptions.mode = t;
1441
- }
1442
- get options() {
1443
- return this.modeOptions.plainFullOption;
1444
- }
1445
- constructor(t) {
1446
- super(), this.modeOptions.setOption(t);
1447
- }
1448
- }
1449
- class Pt extends D {
1450
- /**
1451
- * 全局级别的默认选项
1452
- */
1453
- static modeOptions = new l(c);
1454
- /**
1455
- * 实例级的默认选项
1456
- */
1457
- get modeOptions() {
1458
- return this._modeOptions || (this._modeOptions = new l(c, void 0, this.constructor.modeOptions));
1459
- }
1460
- _modeOptions;
1461
- get mode() {
1462
- return this.modeOptions.mode;
1463
- }
1464
- set mode(t) {
1465
- this.modeOptions.mode = t;
1466
- }
1467
- get options() {
1468
- return this.modeOptions.plainFullOption;
1469
- }
1470
- constructor(t) {
1471
- super(), this.modeOptions.setOption(t);
1472
- }
1473
- }
1474
- function yt(s) {
1475
- const t = C(s);
1476
- return class extends t {
1477
- /**
1478
- * 全局级别的默认选项
1479
- */
1480
- static modeOptions = new l(c);
1481
- /**
1482
- * 实例级的默认选项
1483
- */
1484
- get modeOptions() {
1485
- return this._modeOptions || (this._modeOptions = new l(c, void 0, this.constructor.modeOptions));
1486
- }
1487
- _modeOptions;
1488
- get mode() {
1489
- return this.modeOptions.mode;
1490
- }
1491
- set mode(n) {
1492
- this.modeOptions.mode = n;
1493
- }
1494
- get options() {
1495
- return this.modeOptions.plainFullOption;
1496
- }
1497
- constructor(n) {
1498
- super(), this.modeOptions.setOption(n);
1499
- }
1500
- };
1501
- }
1502
- function _t(s, t, e) {
1503
- const n = h(s, {
1504
- /**
1505
- * 全局级别的默认选项
1506
- */
1507
- modeOptions: new l(t, e)
1508
- });
1509
- return h(n.prototype, {
1510
- /**
1511
- * 实例级的默认选项
1512
- */
1513
- get modeOptions() {
1514
- return this._modeOptions || (this._modeOptions = new l(t, void 0, this.constructor.modeOptions));
1515
- },
1516
- get mode() {
1517
- return this.modeOptions.mode;
1518
- },
1519
- set mode(i) {
1520
- this.modeOptions.mode = i;
1521
- },
1522
- get options() {
1523
- return this.modeOptions.fullOption;
1524
- }
1525
- }), s;
1526
- }
1527
- const wt = {
1528
- onUse(s, t, e) {
1529
- const n = t ?? c;
1530
- u(s, {
1531
- modeOptions: new l(
1532
- n,
1533
- void 0,
1534
- e
1535
- )
1536
- }), u(s.prototype, {
1537
- get modeOptions() {
1538
- const i = this, r = s;
1539
- return i._modeOptions || (i._modeOptions = new l(
1540
- r.modeOptions.mode,
1541
- void 0,
1542
- r.modeOptions
1543
- ));
1544
- },
1545
- get mode() {
1546
- return this.modeOptions.mode;
1547
- },
1548
- set mode(i) {
1549
- const r = this;
1550
- r.modeOptions.mode = i;
1551
- },
1552
- get options() {
1553
- return this.modeOptions.plainFullOption;
1554
- }
1555
- });
1556
- },
1557
- onCreate(s, t) {
1558
- s.modeOptions.setOption(t);
1559
- }
1560
- }, Tt = {
1561
- onUse(s, t, e) {
1562
- u(s, {
1563
- /**
1564
- * 全局级别的默认选项
1565
- */
1566
- defaultOptions: new a(t, e)
1567
- }), u(s.prototype, {
1568
- /**
1569
- * 实例级的默认选项
1570
- */
1571
- get defaultOptions() {
1572
- return this._defaultOptions || (this._defaultOptions = new a(void 0, s.defaultOptions));
1573
- }
1574
- });
1575
- },
1576
- onCreate(s, t) {
1577
- s.defaultOptions.option = t;
1578
- }
1579
- };
1580
- function Et(s, t) {
1581
- const e = h(s, {
1582
- /**
1583
- * 全局级别的默认选项
1584
- */
1585
- defaultOptions: new a(t)
1586
- });
1587
- return h(e.prototype, {
1588
- /**
1589
- * 实例级的默认选项
1590
- */
1591
- get defaultOptions() {
1592
- return this._defaultOptions || (this._defaultOptions = new a(void 0, this.constructor.defaultOptions));
1593
- }
1594
- }), s;
1595
- }
1596
- function _(s, t) {
1597
- const e = [{ target: s, props: t }];
1598
- let n;
1599
- for (; n = e.shift(); ) {
1600
- const { target: i, props: r } = n;
1601
- for (const [o, p] of Object.entries(r)) {
1602
- if (p != null && typeof p == "object" && (!p.constructor || p.constructor === Object)) {
1603
- e.push({ target: i[o], props: p });
1604
- continue;
1605
- }
1606
- i[o] = p;
1607
- }
1608
- }
1609
- return s;
1610
- }
1611
- function A(s, t) {
1612
- const e = {}, n = [{ target: s, props: t, targetProps: e }];
1613
- let i;
1614
- for (; i = n.shift(); ) {
1615
- const { target: r, props: o, targetProps: p } = i;
1616
- for (const [m, f] of Object.entries(o)) {
1617
- if (f != null && typeof f == "object" && (!f.constructor || f.constructor === Object)) {
1618
- n.push({ target: r[m], props: f, targetProps: p[m] = {} });
1619
- continue;
1620
- }
1621
- p[m] = r[m];
1622
- }
1623
- }
1624
- return e;
1625
- }
1626
- function Ut(s, t) {
1627
- const e = A(s, t);
1628
- function n() {
1629
- _(s, t);
1630
- }
1631
- function i() {
1632
- _(s, e);
1633
- }
1634
- return { set: n, unset: i };
1635
- }
1
+ import { E as s, M as a, P as i, a as n, b as r, T as o, c as g, d as P, e as p, f as d, g as x, h as l, i as u, j as T, k as m, l as c, m as M, n as O, o as E, p as H, q as y, r as f, s as b, t as v, u as D, v as B, w as V, x as h, y as k, z as I, A as N, B as S, C as _, D as j, F as q, G as w, H as z, I as A, J as C, K as F, L as G, N as J, O as K, Q as L, R as Q, S as R, U, V as W, W as X, X as Y, Y as Z } from "./decorator-Culqv4k6.js";
2
+ import { P as ee, T as te, a as se } from "./TierOptionsPluginHostEventEmitter-DXTNpSmS.js";
3
+ import { P as ie, T as ne, a as re } from "./TierOptionsPluginHostEventTarget-Bok_zzQ1.js";
1636
4
  export {
1637
- et as ExtendManager,
1638
- S as ModeOptions,
1639
- d as PluginExtendManager,
1640
- v as PluginHost,
1641
- F as PluginHostEventEmitter,
1642
- D as PluginHostEventTarget,
1643
- tt as PluginManager,
1644
- l as TierModeOptions,
1645
- mt as TierModeOptionsPluginHost,
1646
- Mt as TierModeOptionsPluginHostEventEmitter,
1647
- Pt as TierModeOptionsPluginHostEventTarget,
1648
- a as TierOptions,
1649
- gt as TierOptionsPluginHost,
1650
- ht as TierOptionsPluginHostEventEmitter,
1651
- ct as TierOptionsPluginHostEventTarget,
1652
- nt as addDefaultOptions,
1653
- st as addInstOptions,
1654
- j as becomePluginHost,
1655
- dt as becomePluginHost_Extends,
1656
- lt as becomePluginHost_Proxy,
1657
- _t as becomeTierModeOptionsHost,
1658
- Et as becomeTierOptionsHost,
1659
- c as commonModeName,
1660
- L as createDefineExtend,
1661
- K as createDefineMixin,
1662
- Z as createExtendTarget,
1663
- G as createMixinTarget,
1664
- C as createPluginHost,
1665
- Ut as createPropertySetter,
1666
- X as createTargetExtend,
1667
- W as createTargetMixin,
1668
- yt as createTierModeOptionsPluginHost,
1669
- Ot as createTierOptionsPluginHost,
1670
- J as defineExtend,
1671
- B as defineMixin,
1672
- O as extendMark,
1673
- Y as extendTarget,
1674
- y as getPropertyValue,
1675
- it as getPropertyValueByPath,
1676
- A as getTargetProperties,
1677
- I as isPlugin,
1678
- _ as mergeProperties,
1679
- u as mixin,
1680
- h as mixinTarget,
1681
- E as parsePropertyPath,
1682
- T as pickHostExtendMembers,
1683
- U as setPropertyValue,
1684
- rt as setPropertyValueByPath,
1685
- Q as targetExtend,
1686
- R as targetMixin,
1687
- ut as tierModeOptionsDecorator,
1688
- wt as tierModeOptionsPlugin,
1689
- ot as tierOptionsDecorator,
1690
- Tt as tierOptionsPlugin
5
+ s as ExtendManager,
6
+ a as ModeOptions,
7
+ i as PluginExtendManager,
8
+ n as PluginHost,
9
+ ee as PluginHostEventEmitter,
10
+ ie as PluginHostEventTarget,
11
+ r as PluginManager,
12
+ o as TierModeOptions,
13
+ g as TierModeOptionsPluginHost,
14
+ te as TierModeOptionsPluginHostEventEmitter,
15
+ ne as TierModeOptionsPluginHostEventTarget,
16
+ P as TierOptions,
17
+ p as TierOptionsPluginHost,
18
+ se as TierOptionsPluginHostEventEmitter,
19
+ re as TierOptionsPluginHostEventTarget,
20
+ d as addDefaultOptions,
21
+ x as addInstOptions,
22
+ l as becomePluginHost,
23
+ u as becomePluginHost_Extends,
24
+ T as becomePluginHost_Proxy,
25
+ m as becomeTierModeOptionsHost,
26
+ c as becomeTierOptionsHost,
27
+ M as commonModeName,
28
+ O as createDefineExtend,
29
+ E as createDefineMixin,
30
+ H as createExtendTarget,
31
+ y as createMixinTarget,
32
+ f as createPluginHost,
33
+ b as createPropertySetter,
34
+ v as createTargetExtend,
35
+ D as createTargetMixin,
36
+ B as createTierModeOptionsPluginHost,
37
+ V as createTierOptionsPluginHost,
38
+ h as defineExtend,
39
+ k as defineMixin,
40
+ I as extendMark,
41
+ N as extendTarget,
42
+ S as getPropertyValue,
43
+ _ as getPropertyValueByPath,
44
+ j as getTargetProperties,
45
+ q as isPlugin,
46
+ w as mergeProperties,
47
+ z as mixin,
48
+ A as mixinByOmit,
49
+ C as mixinByPick,
50
+ F as mixinIExtend,
51
+ G as mixinTarget,
52
+ J as parsePropertyPath,
53
+ K as pickHostExtendMembers,
54
+ L as setPropertyValue,
55
+ Q as setPropertyValueByPath,
56
+ R as targetExtend,
57
+ U as targetMixin,
58
+ W as tierModeOptionsDecorator,
59
+ X as tierModeOptionsPlugin,
60
+ Y as tierOptionsDecorator,
61
+ Z as tierOptionsPlugin
1691
62
  };