patron-oop 1.45.0 → 1.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/patron.cjs +106 -35
- package/dist/patron.cjs.map +1 -1
- package/dist/patron.d.ts +40 -1
- package/dist/patron.js +103 -36
- package/dist/patron.js.map +1 -1
- package/dist/patron.min.js +1 -1
- package/dist/patron.min.mjs +1 -1
- package/dist/patron.min.mjs.map +1 -1
- package/dist/patron.mjs +103 -36
- package/dist/patron.mjs.map +1 -1
- package/docs/README.md +3 -0
- package/docs/assets/css/base.css +42 -0
- package/docs/assets/favicon/android-icon-144x144.png +0 -0
- package/docs/assets/favicon/android-icon-192x192.png +0 -0
- package/docs/assets/favicon/android-icon-36x36.png +0 -0
- package/docs/assets/favicon/android-icon-48x48.png +0 -0
- package/docs/assets/favicon/android-icon-72x72.png +0 -0
- package/docs/assets/favicon/android-icon-96x96.png +0 -0
- package/docs/assets/favicon/apple-icon-114x114.png +0 -0
- package/docs/assets/favicon/apple-icon-120x120.png +0 -0
- package/docs/assets/favicon/apple-icon-144x144.png +0 -0
- package/docs/assets/favicon/apple-icon-152x152.png +0 -0
- package/docs/assets/favicon/apple-icon-180x180.png +0 -0
- package/docs/assets/favicon/apple-icon-57x57.png +0 -0
- package/docs/assets/favicon/apple-icon-60x60.png +0 -0
- package/docs/assets/favicon/apple-icon-72x72.png +0 -0
- package/docs/assets/favicon/apple-icon-76x76.png +0 -0
- package/docs/assets/favicon/apple-icon-precomposed.png +0 -0
- package/docs/assets/favicon/apple-icon.png +0 -0
- package/docs/assets/favicon/browserconfig.xml +2 -0
- package/docs/assets/favicon/favicon-16x16.png +0 -0
- package/docs/assets/favicon/favicon-32x32.png +0 -0
- package/docs/assets/favicon/favicon-96x96.png +0 -0
- package/docs/assets/favicon/favicon.ico +0 -0
- package/docs/assets/favicon/manifest.json +41 -0
- package/docs/assets/favicon/ms-icon-144x144.png +0 -0
- package/docs/assets/favicon/ms-icon-150x150.png +0 -0
- package/docs/assets/favicon/ms-icon-310x310.png +0 -0
- package/docs/assets/favicon/ms-icon-70x70.png +0 -0
- package/docs/assets/img/404.jpg +0 -0
- package/docs/assets/img/angular_16.jpg +0 -0
- package/docs/assets/img/angular_32.jpg +0 -0
- package/docs/assets/img/eo_16.jpg +0 -0
- package/docs/assets/img/eo_big.png +0 -0
- package/docs/assets/img/github_16.jpg +0 -0
- package/docs/assets/img/logo.jpg +0 -0
- package/docs/assets/img/philosofy/observable.jpg +0 -0
- package/docs/assets/img/philosofy/responsible.jpg +0 -0
- package/docs/assets/img/philosofy/result.jpg +0 -0
- package/docs/assets/img/philosofy/tell.jpg +0 -0
- package/docs/assets/img/react_16.jpg +0 -0
- package/docs/assets/img/react_32.jpg +0 -0
- package/docs/assets/img/vue_16.jpg +0 -0
- package/docs/assets/img/vue_32.jpg +0 -0
- package/docs/assets/js/components/linkDynamic.mjs +11 -0
- package/docs/assets/js/components/linkReloadable.mjs +13 -0
- package/docs/assets/js/entrypoints/compatibility.mjs +31 -0
- package/docs/assets/js/entrypoints/components.mjs +2 -0
- package/docs/assets/js/entrypoints/examples.mjs +25 -0
- package/docs/assets/js/entrypoints/factory.mjs +20 -0
- package/docs/assets/js/entrypoints/guest.mjs +61 -0
- package/docs/assets/js/entrypoints/index.mjs +110 -0
- package/docs/assets/js/entrypoints/integrations.mjs +36 -0
- package/docs/assets/js/entrypoints/patron.mjs +46 -0
- package/docs/assets/js/entrypoints/source.mjs +76 -0
- package/docs/assets/js/entrypoints/terminology.mjs +51 -0
- package/docs/assets/js/entrypoints/utils.mjs +61 -0
- package/docs/assets/js/lib/StyleFetched.mjs +14 -0
- package/docs/assets/js/routing.mjs +110 -0
- package/docs/assets/schemes/dip.html +28 -0
- package/docs/favicon.ico +0 -0
- package/docs/index-dev.html +346 -0
- package/docs/index.html +346 -0
- package/docs/manifest.json +41 -0
- package/docs/pages/404.html +9 -0
- package/docs/pages/common/layout.html +17 -0
- package/docs/pages/compatibility/dip.html +82 -0
- package/docs/pages/compatibility/elegant-objects.html +373 -0
- package/docs/pages/compatibility/layout.html +17 -0
- package/docs/pages/examples/errors.html +167 -0
- package/docs/pages/examples/index.html +10 -0
- package/docs/pages/examples.html +41 -0
- package/docs/pages/factory/index.html +18 -0
- package/docs/pages/factory.html +36 -0
- package/docs/pages/guest/guest-applied.html +51 -0
- package/docs/pages/guest/guest-cast.html +219 -0
- package/docs/pages/guest/guest-disposable.html +147 -0
- package/docs/pages/guest/guest-executor-applied.html +65 -0
- package/docs/pages/guest/guest-object.html +101 -0
- package/docs/pages/guest/guest-pool.html +107 -0
- package/docs/pages/guest/guest-sync.html +66 -0
- package/docs/pages/guest/index.html +115 -0
- package/docs/pages/guest.html +59 -0
- package/docs/pages/index.html +72 -0
- package/docs/pages/integrations/angular.html +5 -0
- package/docs/pages/integrations/layout.html +17 -0
- package/docs/pages/integrations/react.html +7 -0
- package/docs/pages/integrations/vue.html +102 -0
- package/docs/pages/patron/index.html +140 -0
- package/docs/pages/patron/patron-applied.html +66 -0
- package/docs/pages/patron/patron-executor-applied.html +94 -0
- package/docs/pages/patron/patron-once.html +110 -0
- package/docs/pages/patron/patron-pool.html +99 -0
- package/docs/pages/patron.html +50 -0
- package/docs/pages/philosofy.html +210 -0
- package/docs/pages/source/index.html +167 -0
- package/docs/pages/source/source-active.html +113 -0
- package/docs/pages/source/source-all.html +129 -0
- package/docs/pages/source/source-applied.html +73 -0
- package/docs/pages/source/source-dynamic.html +93 -0
- package/docs/pages/source/source-executor-applied.html +64 -0
- package/docs/pages/source/source-map.html +192 -0
- package/docs/pages/source/source-once.html +73 -0
- package/docs/pages/source/source-race.html +171 -0
- package/docs/pages/source/source-sequence.html +160 -0
- package/docs/pages/source/source-with-pool.html +102 -0
- package/docs/pages/source/source.html +167 -0
- package/docs/pages/source.html +68 -0
- package/docs/pages/terminology/guest.html +14 -0
- package/docs/pages/terminology/index.html +6 -0
- package/docs/pages/terminology/introduction.html +25 -0
- package/docs/pages/terminology/patron.html +10 -0
- package/docs/pages/terminology/source.html +55 -0
- package/docs/pages/terminology/visitor.html +19 -0
- package/docs/pages/terminology.html +53 -0
- package/docs/pages/utils/give.html +47 -0
- package/docs/pages/utils/index.html +24 -0
- package/docs/pages/utils/is-guest-aware.html +22 -0
- package/docs/pages/utils/is-guest.html +21 -0
- package/docs/pages/utils/is-patron-in-pools.html +53 -0
- package/docs/pages/utils/private.html +44 -0
- package/docs/pages/utils/remove-patron-from-pools.html +57 -0
- package/docs/pages/utils/value.html +47 -0
- package/docs/pages/utils.html +61 -0
- package/eslint.config.mjs +6 -0
- package/package.json +1 -1
- package/src/Patron/PatronApplied.ts +22 -0
- package/src/Patron/PatronExecutorApplied.ts +25 -0
- package/src/index.ts +4 -0
package/dist/patron.js
CHANGED
@@ -60,9 +60,9 @@ class GuestCast {
|
|
60
60
|
}
|
61
61
|
}
|
62
62
|
|
63
|
-
var __defProp$
|
64
|
-
var __defNormalProp$
|
65
|
-
var __publicField$
|
63
|
+
var __defProp$a = Object.defineProperty;
|
64
|
+
var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
65
|
+
var __publicField$a = (obj, key, value) => __defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
|
66
66
|
const poolSets = /* @__PURE__ */ new Map();
|
67
67
|
const patronPools = (patron) => {
|
68
68
|
const pools = [];
|
@@ -96,8 +96,8 @@ const isPatronInPools = (patron) => {
|
|
96
96
|
class PatronPool {
|
97
97
|
constructor(initiator) {
|
98
98
|
this.initiator = initiator;
|
99
|
-
__publicField$
|
100
|
-
__publicField$
|
99
|
+
__publicField$a(this, "patrons");
|
100
|
+
__publicField$a(this, "give");
|
101
101
|
this.patrons = /* @__PURE__ */ new Set();
|
102
102
|
poolSets.set(this, this.patrons);
|
103
103
|
const doReceive = (value) => {
|
@@ -146,13 +146,13 @@ class PatronPool {
|
|
146
146
|
}
|
147
147
|
}
|
148
148
|
|
149
|
-
var __defProp$
|
150
|
-
var __defNormalProp$
|
151
|
-
var __publicField$
|
149
|
+
var __defProp$9 = Object.defineProperty;
|
150
|
+
var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
151
|
+
var __publicField$9 = (obj, key, value) => __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
|
152
152
|
class GuestPool {
|
153
153
|
constructor(initiator) {
|
154
|
-
__publicField$
|
155
|
-
__publicField$
|
154
|
+
__publicField$9(this, "guests", /* @__PURE__ */ new Set());
|
155
|
+
__publicField$9(this, "patronPool");
|
156
156
|
this.patronPool = new PatronPool(initiator);
|
157
157
|
}
|
158
158
|
give(value) {
|
@@ -262,6 +262,16 @@ class GuestApplied {
|
|
262
262
|
}
|
263
263
|
}
|
264
264
|
|
265
|
+
var __defProp$8 = Object.defineProperty;
|
266
|
+
var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
267
|
+
var __publicField$8 = (obj, key, value) => __defNormalProp$8(obj, key + "" , value);
|
268
|
+
class GuestExecutorApplied {
|
269
|
+
constructor(baseGuest, applier) {
|
270
|
+
__publicField$8(this, "give");
|
271
|
+
this.give = applier((v) => give(v, baseGuest));
|
272
|
+
}
|
273
|
+
}
|
274
|
+
|
265
275
|
class Patron {
|
266
276
|
constructor(willBePatron) {
|
267
277
|
this.willBePatron = willBePatron;
|
@@ -283,13 +293,13 @@ class Patron {
|
|
283
293
|
}
|
284
294
|
const isPatron = (guest) => typeof guest === "object" && guest !== null && guest?.introduction?.() === "patron";
|
285
295
|
|
286
|
-
var __defProp$
|
287
|
-
var __defNormalProp$
|
288
|
-
var __publicField$
|
296
|
+
var __defProp$7 = Object.defineProperty;
|
297
|
+
var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
298
|
+
var __publicField$7 = (obj, key, value) => __defNormalProp$7(obj, key + "" , value);
|
289
299
|
class PatronOnce {
|
290
300
|
constructor(baseGuest) {
|
291
301
|
this.baseGuest = baseGuest;
|
292
|
-
__publicField$
|
302
|
+
__publicField$7(this, "received", false);
|
293
303
|
if (baseGuest === void 0) {
|
294
304
|
throw new Error("PatronOnce didnt receive baseGuest argument");
|
295
305
|
}
|
@@ -313,15 +323,49 @@ class PatronOnce {
|
|
313
323
|
}
|
314
324
|
}
|
315
325
|
|
316
|
-
var __defProp$
|
317
|
-
var __defNormalProp$
|
318
|
-
var __publicField$
|
326
|
+
var __defProp$6 = Object.defineProperty;
|
327
|
+
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
328
|
+
var __publicField$6 = (obj, key, value) => __defNormalProp$6(obj, key + "" , value);
|
329
|
+
class PatronApplied {
|
330
|
+
constructor(baseGuest, applier) {
|
331
|
+
__publicField$6(this, "guestApplied");
|
332
|
+
this.guestApplied = new GuestApplied(baseGuest, applier);
|
333
|
+
}
|
334
|
+
give(value) {
|
335
|
+
this.guestApplied.give(value);
|
336
|
+
return this;
|
337
|
+
}
|
338
|
+
introduction() {
|
339
|
+
return "patron";
|
340
|
+
}
|
341
|
+
}
|
342
|
+
|
343
|
+
var __defProp$5 = Object.defineProperty;
|
344
|
+
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
345
|
+
var __publicField$5 = (obj, key, value) => __defNormalProp$5(obj, key + "" , value);
|
346
|
+
class PatronExecutorApplied {
|
347
|
+
constructor(baseGuest, applier) {
|
348
|
+
__publicField$5(this, "guestApplied");
|
349
|
+
this.guestApplied = new GuestExecutorApplied(baseGuest, applier);
|
350
|
+
}
|
351
|
+
give(value) {
|
352
|
+
this.guestApplied.give(value);
|
353
|
+
return this;
|
354
|
+
}
|
355
|
+
introduction() {
|
356
|
+
return "patron";
|
357
|
+
}
|
358
|
+
}
|
359
|
+
|
360
|
+
var __defProp$4 = Object.defineProperty;
|
361
|
+
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
362
|
+
var __publicField$4 = (obj, key, value) => __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
|
319
363
|
class SourceWithPool {
|
320
364
|
constructor(sourceDocument) {
|
321
365
|
this.sourceDocument = sourceDocument;
|
322
|
-
__publicField$
|
323
|
-
__publicField$
|
324
|
-
__publicField$
|
366
|
+
__publicField$4(this, "thePool", new PatronPool(this));
|
367
|
+
__publicField$4(this, "theEmptyPool", new PatronPool(this));
|
368
|
+
__publicField$4(this, "isEmpty");
|
325
369
|
this.isEmpty = sourceDocument === void 0;
|
326
370
|
}
|
327
371
|
pool() {
|
@@ -353,15 +397,15 @@ class SourceWithPool {
|
|
353
397
|
}
|
354
398
|
}
|
355
399
|
|
356
|
-
var __defProp$
|
357
|
-
var __defNormalProp$
|
358
|
-
var __publicField$
|
400
|
+
var __defProp$3 = Object.defineProperty;
|
401
|
+
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
402
|
+
var __publicField$3 = (obj, key, value) => __defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value);
|
359
403
|
class SourceAll {
|
360
404
|
constructor(initialKnownKeys = []) {
|
361
|
-
__publicField$
|
362
|
-
__publicField$
|
363
|
-
__publicField$
|
364
|
-
__publicField$
|
405
|
+
__publicField$3(this, "theAll");
|
406
|
+
__publicField$3(this, "keysKnown");
|
407
|
+
__publicField$3(this, "keysFilled", /* @__PURE__ */ new Set());
|
408
|
+
__publicField$3(this, "filledAllPool", new GuestPool(this));
|
365
409
|
this.theAll = new SourceWithPool({});
|
366
410
|
this.keysKnown = new Set(initialKnownKeys);
|
367
411
|
}
|
@@ -561,13 +605,13 @@ class SourceRace {
|
|
561
605
|
}
|
562
606
|
}
|
563
607
|
|
564
|
-
var __defProp$
|
565
|
-
var __defNormalProp$
|
566
|
-
var __publicField$
|
608
|
+
var __defProp$2 = Object.defineProperty;
|
609
|
+
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
610
|
+
var __publicField$2 = (obj, key, value) => __defNormalProp$2(obj, key + "" , value);
|
567
611
|
class SourceActive {
|
568
612
|
constructor(configExecutor) {
|
569
613
|
this.configExecutor = configExecutor;
|
570
|
-
__publicField$
|
614
|
+
__publicField$2(this, "source", new SourceWithPool());
|
571
615
|
if (configExecutor === void 0) {
|
572
616
|
throw new Error(
|
573
617
|
"SourceActive constructor didnt receive executor function"
|
@@ -624,18 +668,41 @@ class SourceApplied {
|
|
624
668
|
}
|
625
669
|
}
|
626
670
|
|
627
|
-
var __defProp = Object.defineProperty;
|
628
|
-
var __defNormalProp = (obj, key, value2) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value2 }) : obj[key] = value2;
|
629
|
-
var __publicField = (obj, key, value2) => __defNormalProp(obj, key + "" , value2);
|
671
|
+
var __defProp$1 = Object.defineProperty;
|
672
|
+
var __defNormalProp$1 = (obj, key, value2) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value: value2 }) : obj[key] = value2;
|
673
|
+
var __publicField$1 = (obj, key, value2) => __defNormalProp$1(obj, key + "" , value2);
|
630
674
|
class SourceExecutorApplied {
|
631
675
|
constructor(source, applier) {
|
632
|
-
__publicField(this, "value");
|
676
|
+
__publicField$1(this, "value");
|
633
677
|
this.value = applier((g) => {
|
634
678
|
value(source, g);
|
635
679
|
});
|
636
680
|
}
|
637
681
|
}
|
638
682
|
|
683
|
+
var __defProp = Object.defineProperty;
|
684
|
+
var __defNormalProp = (obj, key, value2) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value2 }) : obj[key] = value2;
|
685
|
+
var __publicField = (obj, key, value2) => __defNormalProp(obj, key + "" , value2);
|
686
|
+
class SourceOnce {
|
687
|
+
constructor(initialValue) {
|
688
|
+
__publicField(this, "source");
|
689
|
+
this.source = new SourceWithPool(initialValue);
|
690
|
+
}
|
691
|
+
value(guest) {
|
692
|
+
value(this.source, guest);
|
693
|
+
return this;
|
694
|
+
}
|
695
|
+
give(value2) {
|
696
|
+
if (!this.source.filled()) {
|
697
|
+
this.source.give(value2);
|
698
|
+
}
|
699
|
+
return this;
|
700
|
+
}
|
701
|
+
pool() {
|
702
|
+
return this.source.pool();
|
703
|
+
}
|
704
|
+
}
|
705
|
+
|
639
706
|
class PrivateClass {
|
640
707
|
constructor(constructorFn, modules = {}) {
|
641
708
|
this.constructorFn = constructorFn;
|
@@ -664,5 +731,5 @@ class Private {
|
|
664
731
|
}
|
665
732
|
}
|
666
733
|
|
667
|
-
export { Guest, GuestApplied, GuestCast, GuestDisposable, GuestObject, GuestPool, GuestSync, Patron, PatronOnce, PatronPool, Private, PrivateClass, Source, SourceActive, SourceAll, SourceApplied, SourceDynamic, SourceExecutorApplied, SourceMap, SourceRace, SourceSequence, SourceWithPool, give, isGuest, isPatron, isPatronInPools, isSource, patronPools, removePatronFromPools, sourceOf, value };
|
734
|
+
export { Guest, GuestApplied, GuestCast, GuestDisposable, GuestExecutorApplied, GuestObject, GuestPool, GuestSync, Patron, PatronApplied, PatronExecutorApplied, PatronOnce, PatronPool, Private, PrivateClass, Source, SourceActive, SourceAll, SourceApplied, SourceDynamic, SourceExecutorApplied, SourceMap, SourceOnce, SourceRace, SourceSequence, SourceWithPool, give, isGuest, isPatron, isPatronInPools, isSource, patronPools, removePatronFromPools, sourceOf, value };
|
668
735
|
//# sourceMappingURL=patron.js.map
|
package/dist/patron.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"patron.js","sources":["../src/Guest/Guest.ts","../src/Guest/GuestCast.ts","../src/Patron/PatronPool.ts","../src/Guest/GuestPool.ts","../src/Guest/GuestSync.ts","../src/Guest/GuestObject.ts","../src/Guest/GuestDisposable.ts","../src/Guest/GuestApplied.ts","../src/Patron/Patron.ts","../src/Patron/PatronOnce.ts","../src/Source/SourceWithPool.ts","../src/Source/SourceAll.ts","../src/Source/Source.ts","../src/Source/SourceSequence.ts","../src/Source/SourceMap.ts","../src/Source/SourceRace.ts","../src/Source/SourceActive.ts","../src/Source/SourceDynamic.ts","../src/Source/SourceApplied.ts","../src/Source/SourceExecutorApplied.ts","../src/Private/PrivateClass.ts","../src/Private/Private.ts"],"sourcesContent":["type GuestIntroduction = \"guest\" | \"patron\";\n\nexport type GuestExecutorType<T = any, This = void> = (value: T) => This;\n\nexport interface GuestObjectType<T = any> {\n give(value: T): this;\n introduction?(): GuestIntroduction;\n}\n\nexport type GuestType<T = any> = GuestExecutorType<T> | GuestObjectType<T>;\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/utils/give\n */\nexport function give<T>(data: T, guest: GuestType<T>) {\n if (data === undefined) {\n throw new Error(\"give didnt receive data argument\");\n }\n if (guest === undefined) {\n throw new Error(\"give didnt receive guest argument\");\n }\n if (typeof guest === \"function\") {\n guest(data);\n } else {\n guest.give(data);\n }\n}\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/utils/is-guest\n */\nexport function isGuest(mbGuest: any): mbGuest is GuestType {\n if (mbGuest === undefined) {\n throw new Error(\"isGuest didnt receive mbGuest argument\");\n }\n return typeof mbGuest === \"function\" || typeof mbGuest?.give === \"function\";\n}\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/guest\n */\nexport class Guest<T> implements GuestObjectType<T> {\n public constructor(private receiver: GuestExecutorType<T>) {\n if (!receiver) {\n throw new Error(\"reseiver function was not passed to Guest constructor\");\n }\n }\n\n public give(value: T) {\n this.receiver(value);\n return this;\n }\n}\n","import { give, GuestType } from \"./Guest\";\nimport { GuestDisposableType, MaybeDisposableType } from \"./GuestDisposable\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/guest/guest-cast\n */\nexport class GuestCast<T> implements GuestDisposableType<T> {\n public constructor(\n private sourceGuest: GuestType<any>,\n private targetGuest: GuestType<T>,\n ) {\n if (sourceGuest === undefined) {\n throw new Error(\"GuestCast didnt receive sourceGuest argument\");\n }\n if (targetGuest === undefined) {\n throw new Error(\"GuestCast didnt receive targetGuest argument\");\n }\n }\n\n public introduction() {\n if (typeof this.sourceGuest === \"function\") {\n return \"guest\";\n }\n if (!this.sourceGuest.introduction) {\n return \"guest\";\n }\n return this.sourceGuest.introduction();\n }\n\n public give(value: T): this {\n give(value, this.targetGuest);\n return this;\n }\n\n public disposed(value: T | null): boolean {\n const maybeDisposable = this.sourceGuest as MaybeDisposableType;\n return maybeDisposable.disposed ? maybeDisposable.disposed(value) : false;\n }\n}\n","import { give, GuestObjectType, GuestType } from \"../Guest/Guest\";\nimport { GuestDisposableType } from \"../Guest/GuestDisposable\";\n\nconst poolSets = new Map<PoolType, Set<GuestObjectType>>();\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/utils/patron-pools\n */\nexport const patronPools = (patron: GuestObjectType) => {\n const pools: PoolType[] = [];\n poolSets.forEach((pool, poolInstance) => {\n if (pool.has(patron)) {\n pools.push(poolInstance);\n }\n });\n return pools;\n};\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/utils/remove-patron-from-pools\n */\nexport const removePatronFromPools = (patron: GuestObjectType) => {\n if (patron === undefined) {\n throw new Error(\"removePatronFromPools didnt receive patron argument\");\n }\n poolSets.forEach((pool) => {\n pool.delete(patron);\n });\n};\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/utils/is-patron-in-pools\n */\nexport const isPatronInPools = (patron: GuestObjectType) => {\n if (patron === undefined) {\n throw new Error(\"isPatronInPools didnt receive patron argument\");\n }\n let inPool = false;\n poolSets.forEach((pool) => {\n if (!inPool) {\n inPool = pool.has(patron);\n }\n });\n return inPool;\n};\n\nexport interface PoolType<T = any> extends GuestObjectType<T> {\n add(guest: GuestObjectType<T>): this;\n distribute(receiving: T, possiblePatron: GuestObjectType<T>): this;\n remove(patron: GuestObjectType<T>): this;\n size(): number;\n}\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/patron/patron-pool\n */\nexport class PatronPool<T> implements PoolType<T> {\n private patrons: Set<GuestObjectType<T>>;\n\n public give: (value: T) => this;\n\n public constructor(private initiator: unknown) {\n this.patrons = new Set<GuestObjectType<T>>();\n poolSets.set(this, this.patrons);\n const doReceive = (value: T) => {\n this.patrons.forEach((target) => {\n this.sendValueToGuest(value, target);\n });\n };\n this.give = (value: T) => {\n doReceive(value);\n return this;\n };\n }\n\n public size(): number {\n return this.patrons.size;\n }\n\n public add(shouldBePatron: GuestType<T>) {\n if (!shouldBePatron) {\n throw new Error(\"PatronPool add method received nothing!\");\n }\n if (\n typeof shouldBePatron !== \"function\" &&\n shouldBePatron.introduction &&\n shouldBePatron.introduction() === \"patron\"\n ) {\n this.patrons.add(shouldBePatron);\n }\n return this;\n }\n\n public remove(patron: GuestObjectType<T>) {\n this.patrons.delete(patron);\n return this;\n }\n\n public distribute(receiving: T, possiblePatron: GuestType<T>): this {\n this.add(possiblePatron);\n this.sendValueToGuest(receiving, possiblePatron);\n return this;\n }\n\n private sendValueToGuest(value: T, guest: GuestType<T>) {\n const isDisposed = this.guestDisposed(value, guest);\n\n if (!isDisposed) {\n give(value, guest);\n }\n }\n\n private guestDisposed(value: T, guest: GuestType<T>) {\n if ((guest as GuestDisposableType).disposed?.(value)) {\n this.remove(guest as GuestObjectType);\n return true;\n }\n\n return false;\n }\n}\n","import { PatronPool, PoolType } from \"../Patron/PatronPool\";\nimport { give, GuestObjectType, GuestType } from \"./Guest\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/guest/guest-pool\n */\nexport class GuestPool<T> implements GuestObjectType<T>, PoolType<T> {\n private guests = new Set<GuestType<T>>();\n\n private patronPool: PatronPool<T>;\n\n public constructor(initiator: unknown) {\n this.patronPool = new PatronPool(initiator);\n }\n\n public give(value: T): this {\n this.deliverToGuests(value);\n this.patronPool.give(value);\n return this;\n }\n\n public add(guest: GuestType<T>): this {\n if (\n typeof guest === \"function\" ||\n !guest.introduction ||\n guest.introduction() === \"guest\"\n ) {\n this.guests.add(guest);\n }\n this.patronPool.add(guest);\n return this;\n }\n\n public remove(patron: GuestObjectType<T>): this {\n this.guests.delete(patron);\n this.patronPool.remove(patron);\n return this;\n }\n\n public distribute(receiving: T, possiblePatron: GuestObjectType<T>): this {\n this.add(possiblePatron);\n this.give(receiving);\n return this;\n }\n\n public size() {\n return this.patronPool.size() + this.guests.size;\n }\n\n private deliverToGuests(value: T) {\n this.guests.forEach((target) => {\n give(value, target);\n });\n this.guests.clear();\n }\n}\n","import { GuestObjectType } from \"./Guest\";\n\nexport interface GuestValueType<T = any> extends GuestObjectType<T> {\n value(): T;\n}\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/guest/guest-sync\n */\nexport class GuestSync<T> implements GuestValueType<T> {\n public constructor(private theValue: T) {\n if (theValue === undefined) {\n throw new Error(\"GuestSync didnt receive theValue argument\");\n }\n }\n\n public give(value: T): this {\n this.theValue = value;\n return this;\n }\n\n public value() {\n return this.theValue;\n }\n}\n","import { Guest, GuestType } from \"./Guest\";\nimport { GuestDisposableType, MaybeDisposableType } from \"./GuestDisposable\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/guest/guest-object\n */\nexport class GuestObject<T> implements GuestDisposableType<T> {\n public constructor(private baseGuest: GuestType<T>) {\n if (baseGuest === undefined) {\n throw new Error(\"GuestObject didnt receive baseGuest argument\");\n }\n }\n\n public give(value: T): this {\n let guest = this.baseGuest;\n if (typeof guest === \"function\") {\n guest = new Guest(guest);\n }\n guest.give(value);\n return this;\n }\n\n public introduction() {\n if (typeof this.baseGuest === \"function\" || !this.baseGuest.introduction) {\n return \"guest\";\n }\n return this.baseGuest.introduction();\n }\n\n public disposed(value: T | null): boolean {\n const maybeDisposable = this.baseGuest as MaybeDisposableType;\n return maybeDisposable.disposed ? maybeDisposable.disposed(value) : false;\n }\n}\n","import { give, GuestObjectType, GuestType } from \"./Guest\";\n\nexport interface GuestDisposableType<T = any> extends GuestObjectType<T> {\n disposed(value: T | null): boolean;\n}\n\nexport type MaybeDisposableType<T = any> = Partial<GuestDisposableType<T>>;\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/guest/guest-disposable\n */\nexport class GuestDisposable<T> implements GuestDisposableType<T> {\n public constructor(\n private guest: GuestType,\n private disposeCheck: (value: T | null) => boolean,\n ) {\n if (guest === undefined) {\n throw new Error(\"GuestDisposable didnt receive guest argument\");\n }\n if (disposeCheck === undefined) {\n throw new Error(\"GuestDisposable didnt receive disposeCheck argument\");\n }\n }\n\n public disposed(value: T | null): boolean {\n return this.disposeCheck(value);\n }\n\n public give(value: T): this {\n give(value, this.guest);\n return this;\n }\n}\n","import { give, GuestObjectType, GuestType } from \"../Guest/Guest\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/guest/guest-applied\n */\nexport class GuestApplied<T, R> implements GuestObjectType<T> {\n public constructor(\n private baseGuest: GuestType<R>,\n private applier: (value: T) => R,\n ) {}\n\n public give(value: T): this {\n give(this.applier(value), this.baseGuest);\n return this;\n }\n}\n","import { give, GuestType } from \"../Guest/Guest\";\nimport { GuestDisposableType } from \"../Guest/GuestDisposable\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/patron\n */\nexport class Patron<T> implements GuestDisposableType<T> {\n public constructor(private willBePatron: GuestType<T>) {\n if (willBePatron === undefined) {\n throw new Error(\"Patron didnt receive willBePatron argument\");\n }\n }\n\n public introduction() {\n return \"patron\" as const;\n }\n\n public give(value: T): this {\n give(value, this.willBePatron);\n return this;\n }\n\n public disposed(value: T | null): boolean {\n const maybeDisposable = this.willBePatron as GuestDisposableType;\n return maybeDisposable?.disposed?.(value) || false;\n }\n}\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/utils/is-patron\n */\nexport const isPatron = (guest: GuestType): guest is Patron<unknown> =>\n typeof guest === \"object\" &&\n guest !== null &&\n guest?.introduction?.() === \"patron\";\n","import { give, GuestType } from \"../Guest/Guest\";\nimport {\n GuestDisposableType,\n MaybeDisposableType,\n} from \"../Guest/GuestDisposable\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/patron/patron-once\n */\nexport class PatronOnce<T> implements GuestDisposableType<T> {\n private received = false;\n\n public constructor(private baseGuest: GuestType<T>) {\n if (baseGuest === undefined) {\n throw new Error(\"PatronOnce didnt receive baseGuest argument\");\n }\n }\n\n public introduction() {\n return \"patron\" as const;\n }\n\n public give(value: T): this {\n if (!this.received) {\n this.received = true;\n give(value, this.baseGuest);\n }\n return this;\n }\n\n public disposed(value: T | null): boolean {\n if (this.received) {\n return true;\n }\n const maybeDisposable = this.baseGuest as MaybeDisposableType;\n return maybeDisposable.disposed ? maybeDisposable.disposed(value) : false;\n }\n}\n","import { Guest, GuestObjectType, GuestType } from \"../Guest/Guest\";\nimport { SourceObjectType } from \"./Source\";\nimport { PatronPool } from \"../Patron/PatronPool\";\nimport { isPatron } from \"../Patron/Patron\";\n\nexport interface PoolAwareType<T = any> {\n pool(): PatronPool<T>;\n}\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/source-with-pool\n */\nexport type SourceWithPoolType<T = any> = SourceObjectType<T> &\n GuestObjectType<T> &\n PoolAwareType<T>;\n\nexport class SourceWithPool<T> implements SourceWithPoolType<T> {\n private thePool = new PatronPool(this);\n private theEmptyPool = new PatronPool(this);\n private isEmpty: boolean;\n\n public constructor(private sourceDocument?: T) {\n this.isEmpty = sourceDocument === undefined;\n }\n\n public pool() {\n return this.thePool;\n }\n\n public give(value: T): this {\n this.isEmpty = false;\n this.sourceDocument = value;\n this.thePool.give(this.sourceDocument);\n this.theEmptyPool.give(this.sourceDocument);\n return this;\n }\n\n public value(guest: GuestType<T>): this {\n if (this.isEmpty) {\n if (isPatron(guest)) {\n this.theEmptyPool.add(guest);\n }\n return this;\n }\n\n if (typeof guest === \"function\") {\n this.thePool.distribute(this.sourceDocument, new Guest(guest));\n } else {\n this.thePool.distribute(this.sourceDocument, guest);\n }\n\n return this;\n }\n\n public filled() {\n return !this.isEmpty;\n }\n}\n","import { SourceObjectType } from \"./Source\";\nimport { SourceWithPool } from \"./SourceWithPool\";\nimport { Guest, GuestObjectType, GuestType } from \"../Guest/Guest\";\nimport { GuestCast } from \"../Guest/GuestCast\";\nimport { GuestObject } from \"../Guest/GuestObject\";\nimport { GuestPool } from \"../Guest/GuestPool\";\n\nexport interface SourceAllType<T = any> extends SourceObjectType<T> {\n valueArray(guest: GuestObjectType<T>): this;\n guestKey<R>(key: string): GuestObjectType<R>;\n}\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/guest/source-all\n */\nexport class SourceAll<T> implements SourceAllType<T> {\n private theAll: SourceWithPool<Record<string, unknown>>;\n\n private keysKnown: Set<string>;\n\n private keysFilled = new Set();\n\n private filledAllPool = new GuestPool(this);\n\n public constructor(initialKnownKeys: string[] = []) {\n this.theAll = new SourceWithPool<Record<string, unknown>>({});\n this.keysKnown = new Set(initialKnownKeys);\n }\n\n public valueArray(guest: GuestType<T>) {\n const guestObject = new GuestObject(guest);\n this.filledAllPool.add(\n new GuestCast(guestObject, (value: Record<string, unknown>) => {\n guestObject.give(Object.values(value) as T);\n }),\n );\n if (this.isAllFilled()) {\n this.theAll.value(\n new Guest((all: Record<string, unknown>) => {\n this.filledAllPool.give(Object.values(all));\n }),\n );\n }\n return this;\n }\n\n public value(guest: GuestType<T>) {\n const guestObject = new GuestObject(guest);\n if (this.isAllFilled()) {\n this.filledAllPool.add(guestObject);\n this.theAll.value(\n new Guest((all) => {\n this.filledAllPool.give(all);\n }),\n );\n } else {\n this.filledAllPool.add(guestObject);\n }\n return this;\n }\n\n public guestKey<R>(key: string): GuestObjectType<R> {\n this.keysKnown.add(key);\n return new Guest((value) => {\n this.theAll.value(\n new Guest((all: Record<string, unknown>) => {\n this.keysFilled.add(key);\n const lastAll = {\n ...all,\n [key]: value,\n };\n this.theAll.give(lastAll);\n if (this.isAllFilled()) {\n this.filledAllPool.give(lastAll);\n }\n }),\n );\n });\n }\n\n private isAllFilled() {\n return (\n this.keysFilled.size > 0 && this.keysFilled.size === this.keysKnown.size\n );\n }\n}\n","import { give, GuestType } from \"../Guest/Guest\";\n\nexport type SourceExecutorType<T> = (guest: GuestType<T>) => unknown;\n\nexport interface SourceObjectType<T> {\n value: SourceExecutorType<T>;\n}\n\nexport type SourceType<T = any> = SourceExecutorType<T> | SourceObjectType<T>;\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/utils/value\n */\nexport function value<T>(source: SourceType<T>, guest: GuestType<T>) {\n if (source === undefined) {\n throw new Error(\"value didnt receive source argument\");\n }\n if (guest === undefined) {\n throw new Error(\"value didnt receive guest argument\");\n }\n if (typeof source === \"function\") {\n return source(guest);\n } else {\n return source.value(guest);\n }\n}\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/utils/is-source\n */\nexport function isSource(mbSource: any): mbSource is SourceType {\n if (mbSource === undefined) {\n throw new Error(\"isSource didnt receive mbSource argument\");\n }\n return (\n typeof mbSource === \"function\" || typeof mbSource?.value === \"function\"\n );\n}\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/guest/source\n */\nexport class Source<T = any> implements SourceObjectType<T> {\n public constructor(private source: SourceType<T>) {\n if (source === undefined) {\n throw new Error(\"Source constructor didnt receive executor function\");\n }\n }\n\n public value(guest: GuestType<T>): GuestType<T> {\n value(this.source, guest);\n return guest;\n }\n}\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/utils/source-of\n */\nexport const sourceOf = <T>(value: T) => new Source<T>((g) => give(value, g));\n","import { SourceWithPool } from \"../Source/SourceWithPool\";\nimport { give, GuestType } from \"../Guest/Guest\";\nimport { GuestCast } from \"../Guest/GuestCast\";\nimport { PatronOnce } from \"../Patron/PatronOnce\";\nimport { PrivateType } from \"../Private/Private\";\nimport { isSource, SourceObjectType, SourceType, value } from \"./Source\";\nimport { SourceAll } from \"./SourceAll\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/guest/source-sequence\n */\nexport class SourceSequence<T, TG> implements SourceObjectType<TG[]> {\n public constructor(\n private baseSource: SourceType<T[]>,\n private targetSource: PrivateType<SourceType<TG>>,\n ) {\n if (baseSource === undefined) {\n throw new Error(\"SourceSequence didnt receive baseSource argument\");\n }\n if (targetSource === undefined) {\n throw new Error(\"SourceSequence didnt receive targetSource argument\");\n }\n }\n\n public value(guest: GuestType<TG[]>) {\n const all = new SourceAll<TG[]>();\n const sequenceSource = new SourceWithPool();\n const targetSource = this.targetSource.get(sequenceSource);\n\n value(\n this.baseSource,\n new GuestCast(guest, (theValue) => {\n let index = 0;\n\n const nextItemHandle = () => {\n if (theValue[index + 1] !== undefined) {\n index = index + 1;\n handle();\n } else {\n all.valueArray(guest);\n }\n };\n\n function handle() {\n sequenceSource.give(null);\n const nextValue = theValue[index];\n if (isSource(nextValue)) {\n value(\n nextValue,\n new PatronOnce((theNextValue) => {\n sequenceSource.give(theNextValue);\n value(targetSource, all.guestKey(index.toString()));\n nextItemHandle();\n }),\n );\n } else {\n sequenceSource.give(nextValue);\n value(targetSource, all.guestKey(index.toString()));\n nextItemHandle();\n }\n }\n\n if (theValue[index] !== undefined) {\n handle();\n } else {\n give([], guest);\n }\n }),\n );\n return this;\n }\n}\n","import { PrivateType } from \"../Private/Private\";\nimport { give, GuestType } from \"../Guest/Guest\";\nimport {\n Source,\n SourceObjectType,\n SourceType,\n isSource,\n value,\n} from \"./Source\";\nimport { SourceAll } from \"./SourceAll\";\nimport { GuestCast } from \"../Guest/GuestCast\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/guest/source-map\n */\nexport class SourceMap<T, TG> implements SourceObjectType<TG[]> {\n public constructor(\n private baseSource: SourceType<T[]>,\n private targetSource: PrivateType<SourceType<TG>>,\n ) {\n if (baseSource === undefined) {\n throw new Error(\"SourceMap didnt receive baseSource argument\");\n }\n if (targetSource === undefined) {\n throw new Error(\"SourceMap didnt receive targetSource argument\");\n }\n }\n\n public value(guest: GuestType<TG[]>) {\n const all = new SourceAll();\n value(\n this.baseSource,\n new GuestCast(<GuestType>guest, (theValue) => {\n theValue.forEach((val, index) => {\n const valueSource = isSource(val)\n ? val\n : new Source((innerGuest) => {\n give(val, innerGuest);\n });\n const targetSource = this.targetSource.get(valueSource);\n value(targetSource, all.guestKey(index.toString()));\n });\n }),\n );\n all.valueArray(<GuestType>guest);\n return this;\n }\n}\n","import { give, GuestType } from \"../Guest/Guest\";\nimport { SourceObjectType, SourceType, value } from \"./Source\";\nimport { GuestCast } from \"../Guest/GuestCast\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/guest/source-race\n */\nexport class SourceRace<T> implements SourceObjectType<T> {\n public constructor(private sources: SourceType<T>[]) {\n if (sources === undefined) {\n throw new Error(\"SourceRace didnt receive sources argument\");\n }\n }\n\n public value(guest: GuestType<T>): this {\n let connectedWithSource: SourceType | null = null;\n this.sources.forEach((source) => {\n value(\n source,\n new GuestCast(<GuestType>guest, (value) => {\n if (!connectedWithSource || connectedWithSource === source) {\n give(value as T, guest);\n connectedWithSource = source;\n }\n }),\n );\n });\n return this;\n }\n}\n","import { GuestType } from \"../Guest/Guest\";\nimport { SourceObjectType } from \"./Source\";\nimport { SourceWithPool, SourceWithPoolType } from \"./SourceWithPool\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/utils/action-type\n */\nexport interface ActionType<P = any> {\n do(config: P): this;\n}\n\nexport interface SourceAcitveType<R = unknown, T = unknown>\n extends SourceObjectType<T>,\n ActionType<R> {}\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/guest/source-active\n */\nexport class SourceActive<R, T> implements SourceAcitveType<R, T> {\n private source = new SourceWithPool<T>();\n\n public constructor(\n private configExecutor: (config: R, source: SourceWithPoolType<T>) => void,\n ) {\n if (configExecutor === undefined) {\n throw new Error(\n \"SourceActive constructor didnt receive executor function\",\n );\n }\n }\n\n public do(config: R): this {\n this.configExecutor(config, this.source);\n return this;\n }\n\n public value(guest: GuestType<T>): this {\n this.source.value(guest);\n return this;\n }\n}\n","import { give, GuestType } from \"../Guest/Guest\";\nimport { SourceType, value } from \"./Source\";\nimport { PatronPool } from \"../Patron/PatronPool\";\nimport { SourceWithPoolType } from \"./SourceWithPool\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/source-dynamic\n */\nexport class SourceDynamic<T = unknown> implements SourceWithPoolType<T> {\n public constructor(\n private baseGuest: GuestType<T>,\n private baseSource: SourceType<T>,\n ) {\n if (baseGuest === undefined) {\n throw new Error(\"SourceDynamic didnt receive baseGuest argument\");\n }\n if (baseSource === undefined) {\n throw new Error(\"SourceDynamic didnt receive baseSource argument\");\n }\n }\n\n public value(guest: GuestType<T>) {\n value(this.baseSource, guest);\n return this;\n }\n\n public give(value: T) {\n give(value, this.baseGuest);\n return this;\n }\n\n public pool(): PatronPool<T> {\n throw Error(\"No pool in SourceDynamic\");\n }\n}\n","import { give, GuestType } from \"../Guest/Guest\";\nimport { GuestCast } from \"../Guest/GuestCast\";\nimport { SourceObjectType, SourceType, value } from \"../Source/Source\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/source/source-applied\n */\nexport class SourceApplied<T, R> implements SourceObjectType<R> {\n public constructor(\n private baseSource: SourceType<T>,\n private applier: (v: T) => R,\n ) {}\n\n public value(g: GuestType<R>) {\n value(\n this.baseSource,\n new GuestCast(g, (v) => {\n give(this.applier(v), g);\n }),\n );\n return this;\n }\n}\n","import {\n SourceExecutorType,\n SourceObjectType,\n SourceType,\n value,\n} from \"../Source/Source\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/source/source-executor-applied\n */\nexport class SourceExecutorApplied<T> implements SourceObjectType<T> {\n public value: SourceExecutorType<T>;\n\n public constructor(\n source: SourceType<T>,\n applier: (executor: SourceExecutorType<T>) => SourceExecutorType<T>,\n ) {\n this.value = applier((g) => {\n value(source, g);\n });\n }\n}\n","import { PrivateType } from \"./Private\";\n\ninterface Constructable<T> {\n new (...args: unknown[]): T;\n}\n\ninterface Prototyped<T> {\n prototype: T;\n}\n\nexport class PrivateClass<T> implements PrivateType<T> {\n public constructor(\n private constructorFn: Prototyped<T>,\n private modules: Record<string, unknown> = {},\n ) {\n if (constructorFn === undefined) {\n throw new Error(\"PrivateClass didnt receive constructorFn argument\");\n }\n }\n\n public get<R extends unknown[], CT = null>(\n ...args: R\n ): CT extends null ? T : CT {\n return new (this.constructorFn as Constructable<T>)(\n ...args,\n this.modules,\n ) as CT extends null ? T : CT;\n }\n}\n","/**\n * @url https://kosukhin.github.io/patron.site/#/utils/private\n */\nexport interface PrivateType<T> {\n get<R extends unknown[], CT = null>(...args: R): CT extends null ? T : CT;\n}\n\nexport class Private<T> implements PrivateType<T> {\n public constructor(private buildingFn: (...args: any[]) => T) {\n if (buildingFn === undefined) {\n throw new Error(\"Private didnt receive buildingFn argument\");\n }\n }\n\n public get<R extends unknown[], CT = null>(\n ...args: R\n ): CT extends null ? T : CT {\n return this.buildingFn(...args) as CT extends null ? T : CT;\n }\n}\n"],"names":["__publicField","value"],"mappings":"AAcgB,SAAA,IAAA,CAAQ,MAAS,KAAqB,EAAA;AACpD,EAAA,IAAI,SAAS,MAAW,EAAA;AACtB,IAAM,MAAA,IAAI,MAAM,kCAAkC,CAAA;AAAA;AAEpD,EAAA,IAAI,UAAU,MAAW,EAAA;AACvB,IAAM,MAAA,IAAI,MAAM,mCAAmC,CAAA;AAAA;AAErD,EAAI,IAAA,OAAO,UAAU,UAAY,EAAA;AAC/B,IAAA,KAAA,CAAM,IAAI,CAAA;AAAA,GACL,MAAA;AACL,IAAA,KAAA,CAAM,KAAK,IAAI,CAAA;AAAA;AAEnB;AAKO,SAAS,QAAQ,OAAoC,EAAA;AAC1D,EAAA,IAAI,YAAY,MAAW,EAAA;AACzB,IAAM,MAAA,IAAI,MAAM,wCAAwC,CAAA;AAAA;AAE1D,EAAA,OAAO,OAAO,OAAA,KAA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A,CACL,QACA,OACA,EAAA;AALF,IAAO,aAAA,CAAA,IAAA,EAAA,OAAA,CAAA;AAML,IAAK,IAAA,CAAA,KAAA,GAAQ,OAAQ,CAAA,CAAC,CAAM,KAAA;AAC1B,MAAA,KAAA,CAAM,QAAQ,CAAC,CAAA;AAAA,KAChB,CAAA;AAAA;AAEL;;ACXO,MAAM,YAA0C,CAAA;AAAA,EAC9C,WACG,CAAA,aAAA,EACA,OAAmC,GAAA,EAC3C,EAAA;AAFQ,IAAA,IAAA,CAAA,aAAA,GAAA,aAAA;AACA,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AAER,IAAA,IAAI,kBAAkB,MAAW,EAAA;AAC/B,MAAM,MAAA,IAAI,MAAM,mDAAmD,CAAA;AAAA;AACrE;AACF,EAEO,OACF,IACuB,EAAA;AAC1B,IAAA,OAAO,IAAK,IAAK,CAAA,aAAA;AAAA,MACf,GAAG,IAAA;AAAA,MACH,IAAK,CAAA;AAAA,KACP;AAAA;AAEJ;;ACrBO,MAAM,OAAqC,CAAA;AAAA,EACzC,YAAoB,UAAmC,EAAA;AAAnC,IAAA,IAAA,CAAA,UAAA,GAAA,UAAA;AACzB,IAAA,IAAI,eAAe,MAAW,EAAA;AAC5B,MAAM,MAAA,IAAI,MAAM,2CAA2C,CAAA;AAAA;AAC7D;AACF,EAEO,OACF,IACuB,EAAA;AAC1B,IAAO,OAAA,IAAA,CAAK,UAAW,CAAA,GAAG,IAAI,CAAA;AAAA;AAElC;;;;"}
|
1
|
+
{"version":3,"file":"patron.js","sources":["../src/Guest/Guest.ts","../src/Guest/GuestCast.ts","../src/Patron/PatronPool.ts","../src/Guest/GuestPool.ts","../src/Guest/GuestSync.ts","../src/Guest/GuestObject.ts","../src/Guest/GuestDisposable.ts","../src/Guest/GuestApplied.ts","../src/Guest/GuestExecutorApplied.ts","../src/Patron/Patron.ts","../src/Patron/PatronOnce.ts","../src/Patron/PatronApplied.ts","../src/Patron/PatronExecutorApplied.ts","../src/Source/SourceWithPool.ts","../src/Source/SourceAll.ts","../src/Source/Source.ts","../src/Source/SourceSequence.ts","../src/Source/SourceMap.ts","../src/Source/SourceRace.ts","../src/Source/SourceActive.ts","../src/Source/SourceDynamic.ts","../src/Source/SourceApplied.ts","../src/Source/SourceExecutorApplied.ts","../src/Source/SourceOnce.ts","../src/Private/PrivateClass.ts","../src/Private/Private.ts"],"sourcesContent":["type GuestIntroduction = \"guest\" | \"patron\";\n\nexport type GuestExecutorType<T = any, This = void> = (value: T) => This;\n\nexport interface GuestObjectType<T = any> {\n give(value: T): this;\n introduction?(): GuestIntroduction;\n}\n\nexport type GuestType<T = any> = GuestExecutorType<T> | GuestObjectType<T>;\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/utils/give\n */\nexport function give<T>(data: T, guest: GuestType<T>) {\n if (data === undefined) {\n throw new Error(\"give didnt receive data argument\");\n }\n if (guest === undefined) {\n throw new Error(\"give didnt receive guest argument\");\n }\n if (typeof guest === \"function\") {\n guest(data);\n } else {\n guest.give(data);\n }\n}\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/utils/is-guest\n */\nexport function isGuest(mbGuest: any): mbGuest is GuestType {\n if (mbGuest === undefined) {\n throw new Error(\"isGuest didnt receive mbGuest argument\");\n }\n return typeof mbGuest === \"function\" || typeof mbGuest?.give === \"function\";\n}\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/guest\n */\nexport class Guest<T> implements GuestObjectType<T> {\n public constructor(private receiver: GuestExecutorType<T>) {\n if (!receiver) {\n throw new Error(\"reseiver function was not passed to Guest constructor\");\n }\n }\n\n public give(value: T) {\n this.receiver(value);\n return this;\n }\n}\n","import { give, GuestType } from \"./Guest\";\nimport { GuestDisposableType, MaybeDisposableType } from \"./GuestDisposable\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/guest/guest-cast\n */\nexport class GuestCast<T> implements GuestDisposableType<T> {\n public constructor(\n private sourceGuest: GuestType<any>,\n private targetGuest: GuestType<T>,\n ) {\n if (sourceGuest === undefined) {\n throw new Error(\"GuestCast didnt receive sourceGuest argument\");\n }\n if (targetGuest === undefined) {\n throw new Error(\"GuestCast didnt receive targetGuest argument\");\n }\n }\n\n public introduction() {\n if (typeof this.sourceGuest === \"function\") {\n return \"guest\";\n }\n if (!this.sourceGuest.introduction) {\n return \"guest\";\n }\n return this.sourceGuest.introduction();\n }\n\n public give(value: T): this {\n give(value, this.targetGuest);\n return this;\n }\n\n public disposed(value: T | null): boolean {\n const maybeDisposable = this.sourceGuest as MaybeDisposableType;\n return maybeDisposable.disposed ? maybeDisposable.disposed(value) : false;\n }\n}\n","import { give, GuestObjectType, GuestType } from \"../Guest/Guest\";\nimport { GuestDisposableType } from \"../Guest/GuestDisposable\";\n\nconst poolSets = new Map<PoolType, Set<GuestObjectType>>();\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/utils/patron-pools\n */\nexport const patronPools = (patron: GuestObjectType) => {\n const pools: PoolType[] = [];\n poolSets.forEach((pool, poolInstance) => {\n if (pool.has(patron)) {\n pools.push(poolInstance);\n }\n });\n return pools;\n};\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/utils/remove-patron-from-pools\n */\nexport const removePatronFromPools = (patron: GuestObjectType) => {\n if (patron === undefined) {\n throw new Error(\"removePatronFromPools didnt receive patron argument\");\n }\n poolSets.forEach((pool) => {\n pool.delete(patron);\n });\n};\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/utils/is-patron-in-pools\n */\nexport const isPatronInPools = (patron: GuestObjectType) => {\n if (patron === undefined) {\n throw new Error(\"isPatronInPools didnt receive patron argument\");\n }\n let inPool = false;\n poolSets.forEach((pool) => {\n if (!inPool) {\n inPool = pool.has(patron);\n }\n });\n return inPool;\n};\n\nexport interface PoolType<T = any> extends GuestObjectType<T> {\n add(guest: GuestObjectType<T>): this;\n distribute(receiving: T, possiblePatron: GuestObjectType<T>): this;\n remove(patron: GuestObjectType<T>): this;\n size(): number;\n}\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/patron/patron-pool\n */\nexport class PatronPool<T> implements PoolType<T> {\n private patrons: Set<GuestObjectType<T>>;\n\n public give: (value: T) => this;\n\n public constructor(private initiator: unknown) {\n this.patrons = new Set<GuestObjectType<T>>();\n poolSets.set(this, this.patrons);\n const doReceive = (value: T) => {\n this.patrons.forEach((target) => {\n this.sendValueToGuest(value, target);\n });\n };\n this.give = (value: T) => {\n doReceive(value);\n return this;\n };\n }\n\n public size(): number {\n return this.patrons.size;\n }\n\n public add(shouldBePatron: GuestType<T>) {\n if (!shouldBePatron) {\n throw new Error(\"PatronPool add method received nothing!\");\n }\n if (\n typeof shouldBePatron !== \"function\" &&\n shouldBePatron.introduction &&\n shouldBePatron.introduction() === \"patron\"\n ) {\n this.patrons.add(shouldBePatron);\n }\n return this;\n }\n\n public remove(patron: GuestObjectType<T>) {\n this.patrons.delete(patron);\n return this;\n }\n\n public distribute(receiving: T, possiblePatron: GuestType<T>): this {\n this.add(possiblePatron);\n this.sendValueToGuest(receiving, possiblePatron);\n return this;\n }\n\n private sendValueToGuest(value: T, guest: GuestType<T>) {\n const isDisposed = this.guestDisposed(value, guest);\n\n if (!isDisposed) {\n give(value, guest);\n }\n }\n\n private guestDisposed(value: T, guest: GuestType<T>) {\n if ((guest as GuestDisposableType).disposed?.(value)) {\n this.remove(guest as GuestObjectType);\n return true;\n }\n\n return false;\n }\n}\n","import { PatronPool, PoolType } from \"../Patron/PatronPool\";\nimport { give, GuestObjectType, GuestType } from \"./Guest\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/guest/guest-pool\n */\nexport class GuestPool<T> implements GuestObjectType<T>, PoolType<T> {\n private guests = new Set<GuestType<T>>();\n\n private patronPool: PatronPool<T>;\n\n public constructor(initiator: unknown) {\n this.patronPool = new PatronPool(initiator);\n }\n\n public give(value: T): this {\n this.deliverToGuests(value);\n this.patronPool.give(value);\n return this;\n }\n\n public add(guest: GuestType<T>): this {\n if (\n typeof guest === \"function\" ||\n !guest.introduction ||\n guest.introduction() === \"guest\"\n ) {\n this.guests.add(guest);\n }\n this.patronPool.add(guest);\n return this;\n }\n\n public remove(patron: GuestObjectType<T>): this {\n this.guests.delete(patron);\n this.patronPool.remove(patron);\n return this;\n }\n\n public distribute(receiving: T, possiblePatron: GuestObjectType<T>): this {\n this.add(possiblePatron);\n this.give(receiving);\n return this;\n }\n\n public size() {\n return this.patronPool.size() + this.guests.size;\n }\n\n private deliverToGuests(value: T) {\n this.guests.forEach((target) => {\n give(value, target);\n });\n this.guests.clear();\n }\n}\n","import { GuestObjectType } from \"./Guest\";\n\nexport interface GuestValueType<T = any> extends GuestObjectType<T> {\n value(): T;\n}\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/guest/guest-sync\n */\nexport class GuestSync<T> implements GuestValueType<T> {\n public constructor(private theValue: T) {\n if (theValue === undefined) {\n throw new Error(\"GuestSync didnt receive theValue argument\");\n }\n }\n\n public give(value: T): this {\n this.theValue = value;\n return this;\n }\n\n public value() {\n return this.theValue;\n }\n}\n","import { Guest, GuestType } from \"./Guest\";\nimport { GuestDisposableType, MaybeDisposableType } from \"./GuestDisposable\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/guest/guest-object\n */\nexport class GuestObject<T> implements GuestDisposableType<T> {\n public constructor(private baseGuest: GuestType<T>) {\n if (baseGuest === undefined) {\n throw new Error(\"GuestObject didnt receive baseGuest argument\");\n }\n }\n\n public give(value: T): this {\n let guest = this.baseGuest;\n if (typeof guest === \"function\") {\n guest = new Guest(guest);\n }\n guest.give(value);\n return this;\n }\n\n public introduction() {\n if (typeof this.baseGuest === \"function\" || !this.baseGuest.introduction) {\n return \"guest\";\n }\n return this.baseGuest.introduction();\n }\n\n public disposed(value: T | null): boolean {\n const maybeDisposable = this.baseGuest as MaybeDisposableType;\n return maybeDisposable.disposed ? maybeDisposable.disposed(value) : false;\n }\n}\n","import { give, GuestObjectType, GuestType } from \"./Guest\";\n\nexport interface GuestDisposableType<T = any> extends GuestObjectType<T> {\n disposed(value: T | null): boolean;\n}\n\nexport type MaybeDisposableType<T = any> = Partial<GuestDisposableType<T>>;\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/guest/guest-disposable\n */\nexport class GuestDisposable<T> implements GuestDisposableType<T> {\n public constructor(\n private guest: GuestType,\n private disposeCheck: (value: T | null) => boolean,\n ) {\n if (guest === undefined) {\n throw new Error(\"GuestDisposable didnt receive guest argument\");\n }\n if (disposeCheck === undefined) {\n throw new Error(\"GuestDisposable didnt receive disposeCheck argument\");\n }\n }\n\n public disposed(value: T | null): boolean {\n return this.disposeCheck(value);\n }\n\n public give(value: T): this {\n give(value, this.guest);\n return this;\n }\n}\n","import { give, GuestObjectType, GuestType } from \"../Guest/Guest\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/guest/guest-applied\n */\nexport class GuestApplied<T, R> implements GuestObjectType<T> {\n public constructor(\n private baseGuest: GuestType<R>,\n private applier: (value: T) => R,\n ) {}\n\n public give(value: T): this {\n give(this.applier(value), this.baseGuest);\n return this;\n }\n}\n","import {\n give,\n GuestExecutorType,\n GuestObjectType,\n GuestType,\n} from \"../Guest/Guest\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/guest/guest-executor-applied\n */\nexport class GuestExecutorApplied<T> implements GuestObjectType<T> {\n public give: GuestExecutorType<T, this>;\n\n public constructor(\n baseGuest: GuestType<T>,\n applier: (executor: GuestExecutorType) => GuestExecutorType,\n ) {\n this.give = applier((v) => give(v, baseGuest)) as GuestExecutorType<\n T,\n this\n >;\n }\n}\n","import { give, GuestType } from \"../Guest/Guest\";\nimport { GuestDisposableType } from \"../Guest/GuestDisposable\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/patron\n */\nexport class Patron<T> implements GuestDisposableType<T> {\n public constructor(private willBePatron: GuestType<T>) {\n if (willBePatron === undefined) {\n throw new Error(\"Patron didnt receive willBePatron argument\");\n }\n }\n\n public introduction() {\n return \"patron\" as const;\n }\n\n public give(value: T): this {\n give(value, this.willBePatron);\n return this;\n }\n\n public disposed(value: T | null): boolean {\n const maybeDisposable = this.willBePatron as GuestDisposableType;\n return maybeDisposable?.disposed?.(value) || false;\n }\n}\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/utils/is-patron\n */\nexport const isPatron = (guest: GuestType): guest is Patron<unknown> =>\n typeof guest === \"object\" &&\n guest !== null &&\n guest?.introduction?.() === \"patron\";\n","import { give, GuestType } from \"../Guest/Guest\";\nimport {\n GuestDisposableType,\n MaybeDisposableType,\n} from \"../Guest/GuestDisposable\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/patron/patron-once\n */\nexport class PatronOnce<T> implements GuestDisposableType<T> {\n private received = false;\n\n public constructor(private baseGuest: GuestType<T>) {\n if (baseGuest === undefined) {\n throw new Error(\"PatronOnce didnt receive baseGuest argument\");\n }\n }\n\n public introduction() {\n return \"patron\" as const;\n }\n\n public give(value: T): this {\n if (!this.received) {\n this.received = true;\n give(value, this.baseGuest);\n }\n return this;\n }\n\n public disposed(value: T | null): boolean {\n if (this.received) {\n return true;\n }\n const maybeDisposable = this.baseGuest as MaybeDisposableType;\n return maybeDisposable.disposed ? maybeDisposable.disposed(value) : false;\n }\n}\n","import { GuestObjectType, GuestType } from \"../Guest/Guest\";\nimport { GuestApplied } from \"../Guest/GuestApplied\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/patron/patron-applied\n */\nexport class PatronApplied<T, R> implements GuestObjectType<T> {\n private guestApplied: GuestApplied<T, R>;\n\n public constructor(baseGuest: GuestType<R>, applier: (value: T) => R) {\n this.guestApplied = new GuestApplied(baseGuest, applier);\n }\n\n public give(value: T): this {\n this.guestApplied.give(value);\n return this;\n }\n\n public introduction(): \"guest\" | \"patron\" {\n return \"patron\";\n }\n}\n","import { GuestExecutorType, GuestObjectType, GuestType } from \"../Guest/Guest\";\nimport { GuestExecutorApplied } from \"../Guest/GuestExecutorApplied\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/patron/patron-executor-applied\n */\nexport class PatronExecutorApplied<T> implements GuestObjectType<T> {\n private guestApplied: GuestExecutorApplied<T>;\n\n public constructor(\n baseGuest: GuestType<T>,\n applier: (executor: GuestExecutorType) => GuestExecutorType,\n ) {\n this.guestApplied = new GuestExecutorApplied(baseGuest, applier);\n }\n\n public give(value: T): this {\n this.guestApplied.give(value);\n return this;\n }\n\n public introduction(): \"guest\" | \"patron\" {\n return \"patron\";\n }\n}\n","import { Guest, GuestObjectType, GuestType } from \"../Guest/Guest\";\nimport { SourceObjectType } from \"./Source\";\nimport { PatronPool } from \"../Patron/PatronPool\";\nimport { isPatron } from \"../Patron/Patron\";\n\nexport interface PoolAwareType<T = any> {\n pool(): PatronPool<T>;\n}\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/source-with-pool\n */\nexport type SourceWithPoolType<T = any> = SourceObjectType<T> &\n GuestObjectType<T> &\n PoolAwareType<T>;\n\nexport class SourceWithPool<T> implements SourceWithPoolType<T> {\n private thePool = new PatronPool(this);\n private theEmptyPool = new PatronPool(this);\n private isEmpty: boolean;\n\n public constructor(private sourceDocument?: T) {\n this.isEmpty = sourceDocument === undefined;\n }\n\n public pool() {\n return this.thePool;\n }\n\n public give(value: T): this {\n this.isEmpty = false;\n this.sourceDocument = value;\n this.thePool.give(this.sourceDocument);\n this.theEmptyPool.give(this.sourceDocument);\n return this;\n }\n\n public value(guest: GuestType<T>): this {\n if (this.isEmpty) {\n if (isPatron(guest)) {\n this.theEmptyPool.add(guest);\n }\n return this;\n }\n\n if (typeof guest === \"function\") {\n this.thePool.distribute(this.sourceDocument, new Guest(guest));\n } else {\n this.thePool.distribute(this.sourceDocument, guest);\n }\n\n return this;\n }\n\n public filled() {\n return !this.isEmpty;\n }\n}\n","import { SourceObjectType } from \"./Source\";\nimport { SourceWithPool } from \"./SourceWithPool\";\nimport { Guest, GuestObjectType, GuestType } from \"../Guest/Guest\";\nimport { GuestCast } from \"../Guest/GuestCast\";\nimport { GuestObject } from \"../Guest/GuestObject\";\nimport { GuestPool } from \"../Guest/GuestPool\";\n\nexport interface SourceAllType<T = any> extends SourceObjectType<T> {\n valueArray(guest: GuestObjectType<T>): this;\n guestKey<R>(key: string): GuestObjectType<R>;\n}\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/guest/source-all\n */\nexport class SourceAll<T> implements SourceAllType<T> {\n private theAll: SourceWithPool<Record<string, unknown>>;\n\n private keysKnown: Set<string>;\n\n private keysFilled = new Set();\n\n private filledAllPool = new GuestPool(this);\n\n public constructor(initialKnownKeys: string[] = []) {\n this.theAll = new SourceWithPool<Record<string, unknown>>({});\n this.keysKnown = new Set(initialKnownKeys);\n }\n\n public valueArray(guest: GuestType<T>) {\n const guestObject = new GuestObject(guest);\n this.filledAllPool.add(\n new GuestCast(guestObject, (value: Record<string, unknown>) => {\n guestObject.give(Object.values(value) as T);\n }),\n );\n if (this.isAllFilled()) {\n this.theAll.value(\n new Guest((all: Record<string, unknown>) => {\n this.filledAllPool.give(Object.values(all));\n }),\n );\n }\n return this;\n }\n\n public value(guest: GuestType<T>) {\n const guestObject = new GuestObject(guest);\n if (this.isAllFilled()) {\n this.filledAllPool.add(guestObject);\n this.theAll.value(\n new Guest((all) => {\n this.filledAllPool.give(all);\n }),\n );\n } else {\n this.filledAllPool.add(guestObject);\n }\n return this;\n }\n\n public guestKey<R>(key: string): GuestObjectType<R> {\n this.keysKnown.add(key);\n return new Guest((value) => {\n this.theAll.value(\n new Guest((all: Record<string, unknown>) => {\n this.keysFilled.add(key);\n const lastAll = {\n ...all,\n [key]: value,\n };\n this.theAll.give(lastAll);\n if (this.isAllFilled()) {\n this.filledAllPool.give(lastAll);\n }\n }),\n );\n });\n }\n\n private isAllFilled() {\n return (\n this.keysFilled.size > 0 && this.keysFilled.size === this.keysKnown.size\n );\n }\n}\n","import { give, GuestType } from \"../Guest/Guest\";\n\nexport type SourceExecutorType<T> = (guest: GuestType<T>) => unknown;\n\nexport interface SourceObjectType<T> {\n value: SourceExecutorType<T>;\n}\n\nexport type SourceType<T = any> = SourceExecutorType<T> | SourceObjectType<T>;\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/utils/value\n */\nexport function value<T>(source: SourceType<T>, guest: GuestType<T>) {\n if (source === undefined) {\n throw new Error(\"value didnt receive source argument\");\n }\n if (guest === undefined) {\n throw new Error(\"value didnt receive guest argument\");\n }\n if (typeof source === \"function\") {\n return source(guest);\n } else {\n return source.value(guest);\n }\n}\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/utils/is-source\n */\nexport function isSource(mbSource: any): mbSource is SourceType {\n if (mbSource === undefined) {\n throw new Error(\"isSource didnt receive mbSource argument\");\n }\n return (\n typeof mbSource === \"function\" || typeof mbSource?.value === \"function\"\n );\n}\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/guest/source\n */\nexport class Source<T = any> implements SourceObjectType<T> {\n public constructor(private source: SourceType<T>) {\n if (source === undefined) {\n throw new Error(\"Source constructor didnt receive executor function\");\n }\n }\n\n public value(guest: GuestType<T>): GuestType<T> {\n value(this.source, guest);\n return guest;\n }\n}\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/utils/source-of\n */\nexport const sourceOf = <T>(value: T) => new Source<T>((g) => give(value, g));\n","import { SourceWithPool } from \"../Source/SourceWithPool\";\nimport { give, GuestType } from \"../Guest/Guest\";\nimport { GuestCast } from \"../Guest/GuestCast\";\nimport { PatronOnce } from \"../Patron/PatronOnce\";\nimport { PrivateType } from \"../Private/Private\";\nimport { isSource, SourceObjectType, SourceType, value } from \"./Source\";\nimport { SourceAll } from \"./SourceAll\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/guest/source-sequence\n */\nexport class SourceSequence<T, TG> implements SourceObjectType<TG[]> {\n public constructor(\n private baseSource: SourceType<T[]>,\n private targetSource: PrivateType<SourceType<TG>>,\n ) {\n if (baseSource === undefined) {\n throw new Error(\"SourceSequence didnt receive baseSource argument\");\n }\n if (targetSource === undefined) {\n throw new Error(\"SourceSequence didnt receive targetSource argument\");\n }\n }\n\n public value(guest: GuestType<TG[]>) {\n const all = new SourceAll<TG[]>();\n const sequenceSource = new SourceWithPool();\n const targetSource = this.targetSource.get(sequenceSource);\n\n value(\n this.baseSource,\n new GuestCast(guest, (theValue) => {\n let index = 0;\n\n const nextItemHandle = () => {\n if (theValue[index + 1] !== undefined) {\n index = index + 1;\n handle();\n } else {\n all.valueArray(guest);\n }\n };\n\n function handle() {\n sequenceSource.give(null);\n const nextValue = theValue[index];\n if (isSource(nextValue)) {\n value(\n nextValue,\n new PatronOnce((theNextValue) => {\n sequenceSource.give(theNextValue);\n value(targetSource, all.guestKey(index.toString()));\n nextItemHandle();\n }),\n );\n } else {\n sequenceSource.give(nextValue);\n value(targetSource, all.guestKey(index.toString()));\n nextItemHandle();\n }\n }\n\n if (theValue[index] !== undefined) {\n handle();\n } else {\n give([], guest);\n }\n }),\n );\n return this;\n }\n}\n","import { PrivateType } from \"../Private/Private\";\nimport { give, GuestType } from \"../Guest/Guest\";\nimport {\n Source,\n SourceObjectType,\n SourceType,\n isSource,\n value,\n} from \"./Source\";\nimport { SourceAll } from \"./SourceAll\";\nimport { GuestCast } from \"../Guest/GuestCast\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/guest/source-map\n */\nexport class SourceMap<T, TG> implements SourceObjectType<TG[]> {\n public constructor(\n private baseSource: SourceType<T[]>,\n private targetSource: PrivateType<SourceType<TG>>,\n ) {\n if (baseSource === undefined) {\n throw new Error(\"SourceMap didnt receive baseSource argument\");\n }\n if (targetSource === undefined) {\n throw new Error(\"SourceMap didnt receive targetSource argument\");\n }\n }\n\n public value(guest: GuestType<TG[]>) {\n const all = new SourceAll();\n value(\n this.baseSource,\n new GuestCast(<GuestType>guest, (theValue) => {\n theValue.forEach((val, index) => {\n const valueSource = isSource(val)\n ? val\n : new Source((innerGuest) => {\n give(val, innerGuest);\n });\n const targetSource = this.targetSource.get(valueSource);\n value(targetSource, all.guestKey(index.toString()));\n });\n }),\n );\n all.valueArray(<GuestType>guest);\n return this;\n }\n}\n","import { give, GuestType } from \"../Guest/Guest\";\nimport { SourceObjectType, SourceType, value } from \"./Source\";\nimport { GuestCast } from \"../Guest/GuestCast\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/guest/source-race\n */\nexport class SourceRace<T> implements SourceObjectType<T> {\n public constructor(private sources: SourceType<T>[]) {\n if (sources === undefined) {\n throw new Error(\"SourceRace didnt receive sources argument\");\n }\n }\n\n public value(guest: GuestType<T>): this {\n let connectedWithSource: SourceType | null = null;\n this.sources.forEach((source) => {\n value(\n source,\n new GuestCast(<GuestType>guest, (value) => {\n if (!connectedWithSource || connectedWithSource === source) {\n give(value as T, guest);\n connectedWithSource = source;\n }\n }),\n );\n });\n return this;\n }\n}\n","import { GuestType } from \"../Guest/Guest\";\nimport { SourceObjectType } from \"./Source\";\nimport { SourceWithPool, SourceWithPoolType } from \"./SourceWithPool\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/utils/action-type\n */\nexport interface ActionType<P = any> {\n do(config: P): this;\n}\n\nexport interface SourceAcitveType<R = unknown, T = unknown>\n extends SourceObjectType<T>,\n ActionType<R> {}\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/guest/source-active\n */\nexport class SourceActive<R, T> implements SourceAcitveType<R, T> {\n private source = new SourceWithPool<T>();\n\n public constructor(\n private configExecutor: (config: R, source: SourceWithPoolType<T>) => void,\n ) {\n if (configExecutor === undefined) {\n throw new Error(\n \"SourceActive constructor didnt receive executor function\",\n );\n }\n }\n\n public do(config: R): this {\n this.configExecutor(config, this.source);\n return this;\n }\n\n public value(guest: GuestType<T>): this {\n this.source.value(guest);\n return this;\n }\n}\n","import { give, GuestType } from \"../Guest/Guest\";\nimport { SourceType, value } from \"./Source\";\nimport { PatronPool } from \"../Patron/PatronPool\";\nimport { SourceWithPoolType } from \"./SourceWithPool\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/source-dynamic\n */\nexport class SourceDynamic<T = unknown> implements SourceWithPoolType<T> {\n public constructor(\n private baseGuest: GuestType<T>,\n private baseSource: SourceType<T>,\n ) {\n if (baseGuest === undefined) {\n throw new Error(\"SourceDynamic didnt receive baseGuest argument\");\n }\n if (baseSource === undefined) {\n throw new Error(\"SourceDynamic didnt receive baseSource argument\");\n }\n }\n\n public value(guest: GuestType<T>) {\n value(this.baseSource, guest);\n return this;\n }\n\n public give(value: T) {\n give(value, this.baseGuest);\n return this;\n }\n\n public pool(): PatronPool<T> {\n throw Error(\"No pool in SourceDynamic\");\n }\n}\n","import { give, GuestType } from \"../Guest/Guest\";\nimport { GuestCast } from \"../Guest/GuestCast\";\nimport { SourceObjectType, SourceType, value } from \"../Source/Source\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/source/source-applied\n */\nexport class SourceApplied<T, R> implements SourceObjectType<R> {\n public constructor(\n private baseSource: SourceType<T>,\n private applier: (v: T) => R,\n ) {}\n\n public value(g: GuestType<R>) {\n value(\n this.baseSource,\n new GuestCast(g, (v) => {\n give(this.applier(v), g);\n }),\n );\n return this;\n }\n}\n","import {\n SourceExecutorType,\n SourceObjectType,\n SourceType,\n value,\n} from \"../Source/Source\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/source/source-executor-applied\n */\nexport class SourceExecutorApplied<T> implements SourceObjectType<T> {\n public value: SourceExecutorType<T>;\n\n public constructor(\n source: SourceType<T>,\n applier: (executor: SourceExecutorType<T>) => SourceExecutorType<T>,\n ) {\n this.value = applier((g) => {\n value(source, g);\n });\n }\n}\n","import { GuestType } from \"../Guest/Guest\";\nimport { PatronPool } from \"../Patron/PatronPool\";\nimport { value } from \"./Source\";\nimport { SourceWithPool, SourceWithPoolType } from \"./SourceWithPool\";\n\n/**\n * @url https://kosukhin.github.io/patron.site/#/source/source-once\n */\nexport class SourceOnce<T> implements SourceWithPoolType<T> {\n private source: SourceWithPool<T>;\n\n public constructor(initialValue?: T) {\n this.source = new SourceWithPool(initialValue);\n }\n\n public value(guest: GuestType<T>) {\n value(this.source, guest);\n return this;\n }\n\n public give(value: T): this {\n if (!this.source.filled()) {\n this.source.give(value);\n }\n return this;\n }\n\n public pool(): PatronPool<T> {\n return this.source.pool();\n }\n}\n","import { PrivateType } from \"./Private\";\n\ninterface Constructable<T> {\n new (...args: unknown[]): T;\n}\n\ninterface Prototyped<T> {\n prototype: T;\n}\n\nexport class PrivateClass<T> implements PrivateType<T> {\n public constructor(\n private constructorFn: Prototyped<T>,\n private modules: Record<string, unknown> = {},\n ) {\n if (constructorFn === undefined) {\n throw new Error(\"PrivateClass didnt receive constructorFn argument\");\n }\n }\n\n public get<R extends unknown[], CT = null>(\n ...args: R\n ): CT extends null ? T : CT {\n return new (this.constructorFn as Constructable<T>)(\n ...args,\n this.modules,\n ) as CT extends null ? T : CT;\n }\n}\n","/**\n * @url https://kosukhin.github.io/patron.site/#/utils/private\n */\nexport interface PrivateType<T> {\n get<R extends unknown[], CT = null>(...args: R): CT extends null ? T : CT;\n}\n\nexport class Private<T> implements PrivateType<T> {\n public constructor(private buildingFn: (...args: any[]) => T) {\n if (buildingFn === undefined) {\n throw new Error(\"Private didnt receive buildingFn argument\");\n }\n }\n\n public get<R extends unknown[], CT = null>(\n ...args: R\n ): CT extends null ? T : CT {\n return this.buildingFn(...args) as CT extends null ? T : CT;\n }\n}\n"],"names":["__publicField","value"],"mappings":"AAcgB,SAAA,IAAA,CAAQ,MAAS,KAAqB,EAAA;AACpD,EAAA,IAAI,SAAS,MAAW,EAAA;AACtB,IAAM,MAAA,IAAI,MAAM,kCAAkC,CAAA;AAAA;AAEpD,EAAA,IAAI,UAAU,MAAW,EAAA;AACvB,IAAM,MAAA,IAAI,MAAM,mCAAmC,CAAA;AAAA;AAErD,EAAI,IAAA,OAAO,UAAU,UAAY,EAAA;AAC/B,IAAA,KAAA,CAAM,IAAI,CAAA;AAAA,GACL,MAAA;AACL,IAAA,KAAA,CAAM,KAAK,IAAI,CAAA;AAAA;AAEnB;AAKO,SAAS,QAAQ,OAAoC,EAAA;AAC1D,EAAA,IAAI,YAAY,MAAW,EAAA;AACzB,IAAM,MA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;AAC7D;AACF,EAEO,OACF,IACuB,EAAA;AAC1B,IAAO,OAAA,IAAA,CAAK,UAAW,CAAA,GAAG,IAAI,CAAA;AAAA;AAElC;;;;"}
|
package/dist/patron.min.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e){"use strict";function t(e,t){if(void 0===e)throw new Error("give didnt receive data argument");if(void 0===t)throw new Error("give didnt receive guest argument");"function"==typeof t?t(e):t.give(e)}class r{constructor(e){if(this.receiver=e,!e)throw new Error("reseiver function was not passed to Guest constructor")}give(e){return this.receiver(e),this}}class i{constructor(e,t){if(this.sourceGuest=e,this.targetGuest=t,void 0===e)throw new Error("GuestCast didnt receive sourceGuest argument");if(void 0===t)throw new Error("GuestCast didnt receive targetGuest argument")}introduction(){return"function"==typeof this.sourceGuest?"guest":this.sourceGuest.introduction?this.sourceGuest.introduction():"guest"}give(e){return t(e,this.targetGuest),this}disposed(e){const t=this.sourceGuest;return!!t.disposed&&t.disposed(e)}}var s=Object.defineProperty,o=(e,t,r)=>((e,t,r)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const n=new Map;class u{constructor(e){this.initiator=e,o(this,"patrons"),o(this,"give"),this.patrons=new Set,n.set(this,this.patrons);const t=e=>{this.patrons.forEach((t=>{this.sendValueToGuest(e,t)}))};this.give=e=>(t(e),this)}size(){return this.patrons.size}add(e){if(!e)throw new Error("PatronPool add method received nothing!");return"function"!=typeof e&&e.introduction&&"patron"===e.introduction()&&this.patrons.add(e),this}remove(e){return this.patrons.delete(e),this}distribute(e,t){return this.add(t),this.sendValueToGuest(e,t),this}sendValueToGuest(e,r){this.guestDisposed(e,r)||t(e,r)}guestDisposed(e,t){return!!t.disposed?.(e)&&(this.remove(t),!0)}}var c=Object.defineProperty,a=(e,t,r)=>((e,t,r)=>t in e?c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class h{constructor(e){a(this,"guests",new Set),a(this,"patronPool"),this.patronPool=new u(e)}give(e){return this.deliverToGuests(e),this.patronPool.give(e),this}add(e){return"function"!=typeof e&&e.introduction&&"guest"!==e.introduction()||this.guests.add(e),this.patronPool.add(e),this}remove(e){return this.guests.delete(e),this.patronPool.remove(e),this}distribute(e,t){return this.add(t),this.give(e),this}size(){return this.patronPool.size()+this.guests.size}deliverToGuests(e){this.guests.forEach((r=>{t(e,r)})),this.guests.clear()}}class l{constructor(e){if(this.baseGuest=e,void 0===e)throw new Error("GuestObject didnt receive baseGuest argument")}give(e){let t=this.baseGuest;return"function"==typeof t&&(t=new r(t)),t.give(e),this}introduction(){return"function"!=typeof this.baseGuest&&this.baseGuest.introduction?this.baseGuest.introduction():"guest"}disposed(e){const t=this.baseGuest;return!!t.disposed&&t.disposed(e)}}const d=e=>"object"==typeof e&&null!==e&&"patron"===e?.introduction?.();var v=Object.defineProperty,g=(e,t,r)=>((e,t,r)=>t in e?v(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,t+"",r);class w{constructor(e){if(this.baseGuest=e,g(this,"received",!1),void 0===e)throw new Error("PatronOnce didnt receive baseGuest argument")}introduction(){return"patron"}give(e){return this.received||(this.received=!0,t(e,this.baseGuest)),this}disposed(e){if(this.received)return!0;const t=this.baseGuest;return!!t.disposed&&t.disposed(e)}}var f=Object.defineProperty,p=(e,t,r)=>((e,t,r)=>t in e?f(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class b{constructor(e){this.sourceDocument=e,p(this,"thePool",new u(this)),p(this,"theEmptyPool",new u(this)),p(this,"isEmpty"),this.isEmpty=void 0===e}pool(){return this.thePool}give(e){return this.isEmpty=!1,this.sourceDocument=e,this.thePool.give(this.sourceDocument),this.theEmptyPool.give(this.sourceDocument),this}value(e){return this.isEmpty?(d(e)&&this.theEmptyPool.add(e),this):("function"==typeof e?this.thePool.distribute(this.sourceDocument,new r(e)):this.thePool.distribute(this.sourceDocument,e),this)}filled(){return!this.isEmpty}}var m=Object.defineProperty,y=(e,t,r)=>((e,t,r)=>t in e?m(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class P{constructor(e=[]){y(this,"theAll"),y(this,"keysKnown"),y(this,"keysFilled",new Set),y(this,"filledAllPool",new h(this)),this.theAll=new b({}),this.keysKnown=new Set(e)}valueArray(e){const t=new l(e);return this.filledAllPool.add(new i(t,(e=>{t.give(Object.values(e))}))),this.isAllFilled()&&this.theAll.value(new r((e=>{this.filledAllPool.give(Object.values(e))}))),this}value(e){const t=new l(e);return this.isAllFilled()?(this.filledAllPool.add(t),this.theAll.value(new r((e=>{this.filledAllPool.give(e)})))):this.filledAllPool.add(t),this}guestKey(e){return this.keysKnown.add(e),new r((t=>{this.theAll.value(new r((r=>{this.keysFilled.add(e);const i={...r,[e]:t};this.theAll.give(i),this.isAllFilled()&&this.filledAllPool.give(i)})))}))}isAllFilled(){return this.keysFilled.size>0&&this.keysFilled.size===this.keysKnown.size}}function S(e,t){if(void 0===e)throw new Error("value didnt receive source argument");if(void 0===t)throw new Error("value didnt receive guest argument");return"function"==typeof e?e(t):e.value(t)}function E(e){if(void 0===e)throw new Error("isSource didnt receive mbSource argument");return"function"==typeof e||"function"==typeof e?.value}class G{constructor(e){if(this.source=e,void 0===e)throw new Error("Source constructor didnt receive executor function")}value(e){return S(this.source,e),e}}var A=Object.defineProperty,F=(e,t,r)=>((e,t,r)=>t in e?A(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,t+"",r);var D=Object.defineProperty,O=(e,t,r)=>((e,t,r)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,t+"",r);e.Guest=r,e.GuestApplied=class{constructor(e,t){this.baseGuest=e,this.applier=t}give(e){return t(this.applier(e),this.baseGuest),this}},e.GuestCast=i,e.GuestDisposable=class{constructor(e,t){if(this.guest=e,this.disposeCheck=t,void 0===e)throw new Error("GuestDisposable didnt receive guest argument");if(void 0===t)throw new Error("GuestDisposable didnt receive disposeCheck argument")}disposed(e){return this.disposeCheck(e)}give(e){return t(e,this.guest),this}},e.GuestObject=l,e.GuestPool=h,e.GuestSync=class{constructor(e){if(this.theValue=e,void 0===e)throw new Error("GuestSync didnt receive theValue argument")}give(e){return this.theValue=e,this}value(){return this.theValue}},e.Patron=class{constructor(e){if(this.willBePatron=e,void 0===e)throw new Error("Patron didnt receive willBePatron argument")}introduction(){return"patron"}give(e){return t(e,this.willBePatron),this}disposed(e){const t=this.willBePatron;return t?.disposed?.(e)||!1}},e.PatronOnce=w,e.PatronPool=u,e.Private=class{constructor(e){if(this.buildingFn=e,void 0===e)throw new Error("Private didnt receive buildingFn argument")}get(...e){return this.buildingFn(...e)}},e.PrivateClass=class{constructor(e,t={}){if(this.constructorFn=e,this.modules=t,void 0===e)throw new Error("PrivateClass didnt receive constructorFn argument")}get(...e){return new this.constructorFn(...e,this.modules)}},e.Source=G,e.SourceActive=class{constructor(e){if(this.configExecutor=e,F(this,"source",new b),void 0===e)throw new Error("SourceActive constructor didnt receive executor function")}do(e){return this.configExecutor(e,this.source),this}value(e){return this.source.value(e),this}},e.SourceAll=P,e.SourceApplied=class{constructor(e,t){this.baseSource=e,this.applier=t}value(e){return S(this.baseSource,new i(e,(r=>{t(this.applier(r),e)}))),this}},e.SourceDynamic=class{constructor(e,t){if(this.baseGuest=e,this.baseSource=t,void 0===e)throw new Error("SourceDynamic didnt receive baseGuest argument");if(void 0===t)throw new Error("SourceDynamic didnt receive baseSource argument")}value(e){return S(this.baseSource,e),this}give(e){return t(e,this.baseGuest),this}pool(){throw Error("No pool in SourceDynamic")}},e.SourceExecutorApplied=class{constructor(e,t){O(this,"value"),this.value=t((t=>{S(e,t)}))}},e.SourceMap=class{constructor(e,t){if(this.baseSource=e,this.targetSource=t,void 0===e)throw new Error("SourceMap didnt receive baseSource argument");if(void 0===t)throw new Error("SourceMap didnt receive targetSource argument")}value(e){const r=new P;return S(this.baseSource,new i(e,(e=>{e.forEach(((e,i)=>{const s=E(e)?e:new G((r=>{t(e,r)}));S(this.targetSource.get(s),r.guestKey(i.toString()))}))}))),r.valueArray(e),this}},e.SourceRace=class{constructor(e){if(this.sources=e,void 0===e)throw new Error("SourceRace didnt receive sources argument")}value(e){let r=null;return this.sources.forEach((s=>{S(s,new i(e,(i=>{r&&r!==s||(t(i,e),r=s)})))})),this}},e.SourceSequence=class{constructor(e,t){if(this.baseSource=e,this.targetSource=t,void 0===e)throw new Error("SourceSequence didnt receive baseSource argument");if(void 0===t)throw new Error("SourceSequence didnt receive targetSource argument")}value(e){const r=new P,s=new b,o=this.targetSource.get(s);return S(this.baseSource,new i(e,(i=>{let n=0;const u=()=>{void 0!==i[n+1]?(n+=1,c()):r.valueArray(e)};function c(){s.give(null);const e=i[n];E(e)?S(e,new w((e=>{s.give(e),S(o,r.guestKey(n.toString())),u()}))):(s.give(e),S(o,r.guestKey(n.toString())),u())}void 0!==i[n]?c():t([],e)}))),this}},e.SourceWithPool=b,e.give=t,e.isGuest=function(e){if(void 0===e)throw new Error("isGuest didnt receive mbGuest argument");return"function"==typeof e||"function"==typeof e?.give},e.isPatron=d,e.isPatronInPools=e=>{if(void 0===e)throw new Error("isPatronInPools didnt receive patron argument");let t=!1;return n.forEach((r=>{t||(t=r.has(e))})),t},e.isSource=E,e.patronPools=e=>{const t=[];return n.forEach(((r,i)=>{r.has(e)&&t.push(i)})),t},e.removePatronFromPools=e=>{if(void 0===e)throw new Error("removePatronFromPools didnt receive patron argument");n.forEach((t=>{t.delete(e)}))},e.sourceOf=e=>new G((r=>t(e,r))),e.value=S}({});
|
1
|
+
!function(e){"use strict";function t(e,t){if(void 0===e)throw new Error("give didnt receive data argument");if(void 0===t)throw new Error("give didnt receive guest argument");"function"==typeof t?t(e):t.give(e)}class r{constructor(e){if(this.receiver=e,!e)throw new Error("reseiver function was not passed to Guest constructor")}give(e){return this.receiver(e),this}}class i{constructor(e,t){if(this.sourceGuest=e,this.targetGuest=t,void 0===e)throw new Error("GuestCast didnt receive sourceGuest argument");if(void 0===t)throw new Error("GuestCast didnt receive targetGuest argument")}introduction(){return"function"==typeof this.sourceGuest?"guest":this.sourceGuest.introduction?this.sourceGuest.introduction():"guest"}give(e){return t(e,this.targetGuest),this}disposed(e){const t=this.sourceGuest;return!!t.disposed&&t.disposed(e)}}var s=Object.defineProperty,o=(e,t,r)=>((e,t,r)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const n=new Map;class u{constructor(e){this.initiator=e,o(this,"patrons"),o(this,"give"),this.patrons=new Set,n.set(this,this.patrons);const t=e=>{this.patrons.forEach((t=>{this.sendValueToGuest(e,t)}))};this.give=e=>(t(e),this)}size(){return this.patrons.size}add(e){if(!e)throw new Error("PatronPool add method received nothing!");return"function"!=typeof e&&e.introduction&&"patron"===e.introduction()&&this.patrons.add(e),this}remove(e){return this.patrons.delete(e),this}distribute(e,t){return this.add(t),this.sendValueToGuest(e,t),this}sendValueToGuest(e,r){this.guestDisposed(e,r)||t(e,r)}guestDisposed(e,t){return!!t.disposed?.(e)&&(this.remove(t),!0)}}var c=Object.defineProperty,a=(e,t,r)=>((e,t,r)=>t in e?c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class l{constructor(e){a(this,"guests",new Set),a(this,"patronPool"),this.patronPool=new u(e)}give(e){return this.deliverToGuests(e),this.patronPool.give(e),this}add(e){return"function"!=typeof e&&e.introduction&&"guest"!==e.introduction()||this.guests.add(e),this.patronPool.add(e),this}remove(e){return this.guests.delete(e),this.patronPool.remove(e),this}distribute(e,t){return this.add(t),this.give(e),this}size(){return this.patronPool.size()+this.guests.size}deliverToGuests(e){this.guests.forEach((r=>{t(e,r)})),this.guests.clear()}}class h{constructor(e){if(this.baseGuest=e,void 0===e)throw new Error("GuestObject didnt receive baseGuest argument")}give(e){let t=this.baseGuest;return"function"==typeof t&&(t=new r(t)),t.give(e),this}introduction(){return"function"!=typeof this.baseGuest&&this.baseGuest.introduction?this.baseGuest.introduction():"guest"}disposed(e){const t=this.baseGuest;return!!t.disposed&&t.disposed(e)}}class d{constructor(e,t){this.baseGuest=e,this.applier=t}give(e){return t(this.applier(e),this.baseGuest),this}}var v=Object.defineProperty,g=(e,t,r)=>((e,t,r)=>t in e?v(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,t+"",r);class p{constructor(e,r){g(this,"give"),this.give=r((r=>t(r,e)))}}const w=e=>"object"==typeof e&&null!==e&&"patron"===e?.introduction?.();var f=Object.defineProperty,b=(e,t,r)=>((e,t,r)=>t in e?f(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,t+"",r);class m{constructor(e){if(this.baseGuest=e,b(this,"received",!1),void 0===e)throw new Error("PatronOnce didnt receive baseGuest argument")}introduction(){return"patron"}give(e){return this.received||(this.received=!0,t(e,this.baseGuest)),this}disposed(e){if(this.received)return!0;const t=this.baseGuest;return!!t.disposed&&t.disposed(e)}}var P=Object.defineProperty,y=(e,t,r)=>((e,t,r)=>t in e?P(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,t+"",r);var S=Object.defineProperty,E=(e,t,r)=>((e,t,r)=>t in e?S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,t+"",r);var G=Object.defineProperty,A=(e,t,r)=>((e,t,r)=>t in e?G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class O{constructor(e){this.sourceDocument=e,A(this,"thePool",new u(this)),A(this,"theEmptyPool",new u(this)),A(this,"isEmpty"),this.isEmpty=void 0===e}pool(){return this.thePool}give(e){return this.isEmpty=!1,this.sourceDocument=e,this.thePool.give(this.sourceDocument),this.theEmptyPool.give(this.sourceDocument),this}value(e){return this.isEmpty?(w(e)&&this.theEmptyPool.add(e),this):("function"==typeof e?this.thePool.distribute(this.sourceDocument,new r(e)):this.thePool.distribute(this.sourceDocument,e),this)}filled(){return!this.isEmpty}}var j=Object.defineProperty,F=(e,t,r)=>((e,t,r)=>t in e?j(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class D{constructor(e=[]){F(this,"theAll"),F(this,"keysKnown"),F(this,"keysFilled",new Set),F(this,"filledAllPool",new l(this)),this.theAll=new O({}),this.keysKnown=new Set(e)}valueArray(e){const t=new h(e);return this.filledAllPool.add(new i(t,(e=>{t.give(Object.values(e))}))),this.isAllFilled()&&this.theAll.value(new r((e=>{this.filledAllPool.give(Object.values(e))}))),this}value(e){const t=new h(e);return this.isAllFilled()?(this.filledAllPool.add(t),this.theAll.value(new r((e=>{this.filledAllPool.give(e)})))):this.filledAllPool.add(t),this}guestKey(e){return this.keysKnown.add(e),new r((t=>{this.theAll.value(new r((r=>{this.keysFilled.add(e);const i={...r,[e]:t};this.theAll.give(i),this.isAllFilled()&&this.filledAllPool.give(i)})))}))}isAllFilled(){return this.keysFilled.size>0&&this.keysFilled.size===this.keysKnown.size}}function k(e,t){if(void 0===e)throw new Error("value didnt receive source argument");if(void 0===t)throw new Error("value didnt receive guest argument");return"function"==typeof e?e(t):e.value(t)}function z(e){if(void 0===e)throw new Error("isSource didnt receive mbSource argument");return"function"==typeof e||"function"==typeof e?.value}class C{constructor(e){if(this.source=e,void 0===e)throw new Error("Source constructor didnt receive executor function")}value(e){return k(this.source,e),e}}var K=Object.defineProperty,x=(e,t,r)=>((e,t,r)=>t in e?K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,t+"",r);var V=Object.defineProperty,T=(e,t,r)=>((e,t,r)=>t in e?V(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,t+"",r);var B=Object.defineProperty,M=(e,t,r)=>((e,t,r)=>t in e?B(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,t+"",r);e.Guest=r,e.GuestApplied=d,e.GuestCast=i,e.GuestDisposable=class{constructor(e,t){if(this.guest=e,this.disposeCheck=t,void 0===e)throw new Error("GuestDisposable didnt receive guest argument");if(void 0===t)throw new Error("GuestDisposable didnt receive disposeCheck argument")}disposed(e){return this.disposeCheck(e)}give(e){return t(e,this.guest),this}},e.GuestExecutorApplied=p,e.GuestObject=h,e.GuestPool=l,e.GuestSync=class{constructor(e){if(this.theValue=e,void 0===e)throw new Error("GuestSync didnt receive theValue argument")}give(e){return this.theValue=e,this}value(){return this.theValue}},e.Patron=class{constructor(e){if(this.willBePatron=e,void 0===e)throw new Error("Patron didnt receive willBePatron argument")}introduction(){return"patron"}give(e){return t(e,this.willBePatron),this}disposed(e){const t=this.willBePatron;return t?.disposed?.(e)||!1}},e.PatronApplied=class{constructor(e,t){y(this,"guestApplied"),this.guestApplied=new d(e,t)}give(e){return this.guestApplied.give(e),this}introduction(){return"patron"}},e.PatronExecutorApplied=class{constructor(e,t){E(this,"guestApplied"),this.guestApplied=new p(e,t)}give(e){return this.guestApplied.give(e),this}introduction(){return"patron"}},e.PatronOnce=m,e.PatronPool=u,e.Private=class{constructor(e){if(this.buildingFn=e,void 0===e)throw new Error("Private didnt receive buildingFn argument")}get(...e){return this.buildingFn(...e)}},e.PrivateClass=class{constructor(e,t={}){if(this.constructorFn=e,this.modules=t,void 0===e)throw new Error("PrivateClass didnt receive constructorFn argument")}get(...e){return new this.constructorFn(...e,this.modules)}},e.Source=C,e.SourceActive=class{constructor(e){if(this.configExecutor=e,x(this,"source",new O),void 0===e)throw new Error("SourceActive constructor didnt receive executor function")}do(e){return this.configExecutor(e,this.source),this}value(e){return this.source.value(e),this}},e.SourceAll=D,e.SourceApplied=class{constructor(e,t){this.baseSource=e,this.applier=t}value(e){return k(this.baseSource,new i(e,(r=>{t(this.applier(r),e)}))),this}},e.SourceDynamic=class{constructor(e,t){if(this.baseGuest=e,this.baseSource=t,void 0===e)throw new Error("SourceDynamic didnt receive baseGuest argument");if(void 0===t)throw new Error("SourceDynamic didnt receive baseSource argument")}value(e){return k(this.baseSource,e),this}give(e){return t(e,this.baseGuest),this}pool(){throw Error("No pool in SourceDynamic")}},e.SourceExecutorApplied=class{constructor(e,t){T(this,"value"),this.value=t((t=>{k(e,t)}))}},e.SourceMap=class{constructor(e,t){if(this.baseSource=e,this.targetSource=t,void 0===e)throw new Error("SourceMap didnt receive baseSource argument");if(void 0===t)throw new Error("SourceMap didnt receive targetSource argument")}value(e){const r=new D;return k(this.baseSource,new i(e,(e=>{e.forEach(((e,i)=>{const s=z(e)?e:new C((r=>{t(e,r)}));k(this.targetSource.get(s),r.guestKey(i.toString()))}))}))),r.valueArray(e),this}},e.SourceOnce=class{constructor(e){M(this,"source"),this.source=new O(e)}value(e){return k(this.source,e),this}give(e){return this.source.filled()||this.source.give(e),this}pool(){return this.source.pool()}},e.SourceRace=class{constructor(e){if(this.sources=e,void 0===e)throw new Error("SourceRace didnt receive sources argument")}value(e){let r=null;return this.sources.forEach((s=>{k(s,new i(e,(i=>{r&&r!==s||(t(i,e),r=s)})))})),this}},e.SourceSequence=class{constructor(e,t){if(this.baseSource=e,this.targetSource=t,void 0===e)throw new Error("SourceSequence didnt receive baseSource argument");if(void 0===t)throw new Error("SourceSequence didnt receive targetSource argument")}value(e){const r=new D,s=new O,o=this.targetSource.get(s);return k(this.baseSource,new i(e,(i=>{let n=0;const u=()=>{void 0!==i[n+1]?(n+=1,c()):r.valueArray(e)};function c(){s.give(null);const e=i[n];z(e)?k(e,new m((e=>{s.give(e),k(o,r.guestKey(n.toString())),u()}))):(s.give(e),k(o,r.guestKey(n.toString())),u())}void 0!==i[n]?c():t([],e)}))),this}},e.SourceWithPool=O,e.give=t,e.isGuest=function(e){if(void 0===e)throw new Error("isGuest didnt receive mbGuest argument");return"function"==typeof e||"function"==typeof e?.give},e.isPatron=w,e.isPatronInPools=e=>{if(void 0===e)throw new Error("isPatronInPools didnt receive patron argument");let t=!1;return n.forEach((r=>{t||(t=r.has(e))})),t},e.isSource=z,e.patronPools=e=>{const t=[];return n.forEach(((r,i)=>{r.has(e)&&t.push(i)})),t},e.removePatronFromPools=e=>{if(void 0===e)throw new Error("removePatronFromPools didnt receive patron argument");n.forEach((t=>{t.delete(e)}))},e.sourceOf=e=>new C((r=>t(e,r))),e.value=k}({});
|
package/dist/patron.min.mjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
function e(e,t){if(void 0===e)throw new Error("give didnt receive data argument");if(void 0===t)throw new Error("give didnt receive guest argument");"function"==typeof t?t(e):t.give(e)}function t(e){if(void 0===e)throw new Error("isGuest didnt receive mbGuest argument");return"function"==typeof e||"function"==typeof e?.give}class r{constructor(e){if(this.receiver=e,!e)throw new Error("reseiver function was not passed to Guest constructor")}give(e){return this.receiver(e),this}}class i{constructor(e,t){if(this.sourceGuest=e,this.targetGuest=t,void 0===e)throw new Error("GuestCast didnt receive sourceGuest argument");if(void 0===t)throw new Error("GuestCast didnt receive targetGuest argument")}introduction(){return"function"==typeof this.sourceGuest?"guest":this.sourceGuest.introduction?this.sourceGuest.introduction():"guest"}give(t){return e(t,this.targetGuest),this}disposed(e){const t=this.sourceGuest;return!!t.disposed&&t.disposed(e)}}var s=Object.defineProperty,o=(e,t,r)=>((e,t,r)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const n=new Map,u=e=>{const t=[];return n.forEach(((r,i)=>{r.has(e)&&t.push(i)})),t},c=e=>{if(void 0===e)throw new Error("removePatronFromPools didnt receive patron argument");n.forEach((t=>{t.delete(e)}))},h=e=>{if(void 0===e)throw new Error("isPatronInPools didnt receive patron argument");let t=!1;return n.forEach((r=>{t||(t=r.has(e))})),t};class a{constructor(e){this.initiator=e,o(this,"patrons"),o(this,"give"),this.patrons=new Set,n.set(this,this.patrons);const t=e=>{this.patrons.forEach((t=>{this.sendValueToGuest(e,t)}))};this.give=e=>(t(e),this)}size(){return this.patrons.size}add(e){if(!e)throw new Error("PatronPool add method received nothing!");return"function"!=typeof e&&e.introduction&&"patron"===e.introduction()&&this.patrons.add(e),this}remove(e){return this.patrons.delete(e),this}distribute(e,t){return this.add(t),this.sendValueToGuest(e,t),this}sendValueToGuest(t,r){this.guestDisposed(t,r)||e(t,r)}guestDisposed(e,t){return!!t.disposed?.(e)&&(this.remove(t),!0)}}var l=Object.defineProperty,d=(e,t,r)=>((e,t,r)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class v{constructor(e){d(this,"guests",new Set),d(this,"patronPool"),this.patronPool=new a(e)}give(e){return this.deliverToGuests(e),this.patronPool.give(e),this}add(e){return"function"!=typeof e&&e.introduction&&"guest"!==e.introduction()||this.guests.add(e),this.patronPool.add(e),this}remove(e){return this.guests.delete(e),this.patronPool.remove(e),this}distribute(e,t){return this.add(t),this.give(e),this}size(){return this.patronPool.size()+this.guests.size}deliverToGuests(t){this.guests.forEach((r=>{e(t,r)})),this.guests.clear()}}class w{constructor(e){if(this.theValue=e,void 0===e)throw new Error("GuestSync didnt receive theValue argument")}give(e){return this.theValue=e,this}value(){return this.theValue}}class g{constructor(e){if(this.baseGuest=e,void 0===e)throw new Error("GuestObject didnt receive baseGuest argument")}give(e){let t=this.baseGuest;return"function"==typeof t&&(t=new r(t)),t.give(e),this}introduction(){return"function"!=typeof this.baseGuest&&this.baseGuest.introduction?this.baseGuest.introduction():"guest"}disposed(e){const t=this.baseGuest;return!!t.disposed&&t.disposed(e)}}class f{constructor(e,t){if(this.guest=e,this.disposeCheck=t,void 0===e)throw new Error("GuestDisposable didnt receive guest argument");if(void 0===t)throw new Error("GuestDisposable didnt receive disposeCheck argument")}disposed(e){return this.disposeCheck(e)}give(t){return e(t,this.guest),this}}class p{constructor(e,t){this.baseGuest=e,this.applier=t}give(t){return e(this.applier(t),this.baseGuest),this}}class b{constructor(e){if(this.willBePatron=e,void 0===e)throw new Error("Patron didnt receive willBePatron argument")}introduction(){return"patron"}give(t){return e(t,this.willBePatron),this}disposed(e){const t=this.willBePatron;return t?.disposed?.(e)||!1}}const m=e=>"object"==typeof e&&null!==e&&"patron"===e?.introduction?.();var y=Object.defineProperty,E=(e,t,r)=>((e,t,r)=>t in e?y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,t+"",r);class P{constructor(e){if(this.baseGuest=e,E(this,"received",!1),void 0===e)throw new Error("PatronOnce didnt receive baseGuest argument")}introduction(){return"patron"}give(t){return this.received||(this.received=!0,e(t,this.baseGuest)),this}disposed(e){if(this.received)return!0;const t=this.baseGuest;return!!t.disposed&&t.disposed(e)}}var G=Object.defineProperty,S=(e,t,r)=>((e,t,r)=>t in e?G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class A{constructor(e){this.sourceDocument=e,S(this,"thePool",new a(this)),S(this,"theEmptyPool",new a(this)),S(this,"isEmpty"),this.isEmpty=void 0===e}pool(){return this.thePool}give(e){return this.isEmpty=!1,this.sourceDocument=e,this.thePool.give(this.sourceDocument),this.theEmptyPool.give(this.sourceDocument),this}value(e){return this.isEmpty?(m(e)&&this.theEmptyPool.add(e),this):("function"==typeof e?this.thePool.distribute(this.sourceDocument,new r(e)):this.thePool.distribute(this.sourceDocument,e),this)}filled(){return!this.isEmpty}}var F=Object.defineProperty,D=(e,t,r)=>((e,t,r)=>t in e?F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class j{constructor(e=[]){D(this,"theAll"),D(this,"keysKnown"),D(this,"keysFilled",new Set),D(this,"filledAllPool",new v(this)),this.theAll=new A({}),this.keysKnown=new Set(e)}valueArray(e){const t=new g(e);return this.filledAllPool.add(new i(t,(e=>{t.give(Object.values(e))}))),this.isAllFilled()&&this.theAll.value(new r((e=>{this.filledAllPool.give(Object.values(e))}))),this}value(e){const t=new g(e);return this.isAllFilled()?(this.filledAllPool.add(t),this.theAll.value(new r((e=>{this.filledAllPool.give(e)})))):this.filledAllPool.add(t),this}guestKey(e){return this.keysKnown.add(e),new r((t=>{this.theAll.value(new r((r=>{this.keysFilled.add(e);const i={...r,[e]:t};this.theAll.give(i),this.isAllFilled()&&this.filledAllPool.give(i)})))}))}isAllFilled(){return this.keysFilled.size>0&&this.keysFilled.size===this.keysKnown.size}}function k(e,t){if(void 0===e)throw new Error("value didnt receive source argument");if(void 0===t)throw new Error("value didnt receive guest argument");return"function"==typeof e?e(t):e.value(t)}function O(e){if(void 0===e)throw new Error("isSource didnt receive mbSource argument");return"function"==typeof e||"function"==typeof e?.value}class z{constructor(e){if(this.source=e,void 0===e)throw new Error("Source constructor didnt receive executor function")}value(e){return k(this.source,e),e}}const K=t=>new z((r=>e(t,r)));class V{constructor(e,t){if(this.baseSource=e,this.targetSource=t,void 0===e)throw new Error("SourceSequence didnt receive baseSource argument");if(void 0===t)throw new Error("SourceSequence didnt receive targetSource argument")}value(t){const r=new j,s=new A,o=this.targetSource.get(s);return k(this.baseSource,new i(t,(i=>{let n=0;const u=()=>{void 0!==i[n+1]?(n+=1,c()):r.valueArray(t)};function c(){s.give(null);const e=i[n];O(e)?k(e,new P((e=>{s.give(e),k(o,r.guestKey(n.toString())),u()}))):(s.give(e),k(o,r.guestKey(n.toString())),u())}void 0!==i[n]?c():e([],t)}))),this}}class C{constructor(e,t){if(this.baseSource=e,this.targetSource=t,void 0===e)throw new Error("SourceMap didnt receive baseSource argument");if(void 0===t)throw new Error("SourceMap didnt receive targetSource argument")}value(t){const r=new j;return k(this.baseSource,new i(t,(t=>{t.forEach(((t,i)=>{const s=O(t)?t:new z((r=>{e(t,r)}));k(this.targetSource.get(s),r.guestKey(i.toString()))}))}))),r.valueArray(t),this}}class x{constructor(e){if(this.sources=e,void 0===e)throw new Error("SourceRace didnt receive sources argument")}value(t){let r=null;return this.sources.forEach((s=>{k(s,new i(t,(i=>{r&&r!==s||(e(i,t),r=s)})))})),this}}var T=Object.defineProperty,B=(e,t,r)=>((e,t,r)=>t in e?T(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,t+"",r);class M{constructor(e){if(this.configExecutor=e,B(this,"source",new A),void 0===e)throw new Error("SourceActive constructor didnt receive executor function")}do(e){return this.configExecutor(e,this.source),this}value(e){return this.source.value(e),this}}class q{constructor(e,t){if(this.baseGuest=e,this.baseSource=t,void 0===e)throw new Error("SourceDynamic didnt receive baseGuest argument");if(void 0===t)throw new Error("SourceDynamic didnt receive baseSource argument")}value(e){return k(this.baseSource,e),this}give(t){return e(t,this.baseGuest),this}pool(){throw Error("No pool in SourceDynamic")}}class I{constructor(e,t){this.baseSource=e,this.applier=t}value(t){return k(this.baseSource,new i(t,(r=>{e(this.applier(r),t)}))),this}}var N=Object.defineProperty,R=(e,t,r)=>((e,t,r)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,t+"",r);class H{constructor(e,t){R(this,"value"),this.value=t((t=>{k(e,t)}))}}class J{constructor(e,t={}){if(this.constructorFn=e,this.modules=t,void 0===e)throw new Error("PrivateClass didnt receive constructorFn argument")}get(...e){return new this.constructorFn(...e,this.modules)}}class L{constructor(e){if(this.buildingFn=e,void 0===e)throw new Error("Private didnt receive buildingFn argument")}get(...e){return this.buildingFn(...e)}}export{r as Guest,p as GuestApplied,i as GuestCast,f as GuestDisposable,g as GuestObject,v as GuestPool,w as GuestSync,b as Patron,P as PatronOnce,a as PatronPool,L as Private,J as PrivateClass,z as Source,M as SourceActive,j as SourceAll,I as SourceApplied,q as SourceDynamic,H as SourceExecutorApplied,C as SourceMap,x as SourceRace,V as SourceSequence,A as SourceWithPool,e as give,t as isGuest,m as isPatron,h as isPatronInPools,O as isSource,u as patronPools,c as removePatronFromPools,K as sourceOf,k as value};
|
1
|
+
function e(e,t){if(void 0===e)throw new Error("give didnt receive data argument");if(void 0===t)throw new Error("give didnt receive guest argument");"function"==typeof t?t(e):t.give(e)}function t(e){if(void 0===e)throw new Error("isGuest didnt receive mbGuest argument");return"function"==typeof e||"function"==typeof e?.give}class r{constructor(e){if(this.receiver=e,!e)throw new Error("reseiver function was not passed to Guest constructor")}give(e){return this.receiver(e),this}}class i{constructor(e,t){if(this.sourceGuest=e,this.targetGuest=t,void 0===e)throw new Error("GuestCast didnt receive sourceGuest argument");if(void 0===t)throw new Error("GuestCast didnt receive targetGuest argument")}introduction(){return"function"==typeof this.sourceGuest?"guest":this.sourceGuest.introduction?this.sourceGuest.introduction():"guest"}give(t){return e(t,this.targetGuest),this}disposed(e){const t=this.sourceGuest;return!!t.disposed&&t.disposed(e)}}var s=Object.defineProperty,o=(e,t,r)=>((e,t,r)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const n=new Map,u=e=>{const t=[];return n.forEach(((r,i)=>{r.has(e)&&t.push(i)})),t},c=e=>{if(void 0===e)throw new Error("removePatronFromPools didnt receive patron argument");n.forEach((t=>{t.delete(e)}))},h=e=>{if(void 0===e)throw new Error("isPatronInPools didnt receive patron argument");let t=!1;return n.forEach((r=>{t||(t=r.has(e))})),t};class a{constructor(e){this.initiator=e,o(this,"patrons"),o(this,"give"),this.patrons=new Set,n.set(this,this.patrons);const t=e=>{this.patrons.forEach((t=>{this.sendValueToGuest(e,t)}))};this.give=e=>(t(e),this)}size(){return this.patrons.size}add(e){if(!e)throw new Error("PatronPool add method received nothing!");return"function"!=typeof e&&e.introduction&&"patron"===e.introduction()&&this.patrons.add(e),this}remove(e){return this.patrons.delete(e),this}distribute(e,t){return this.add(t),this.sendValueToGuest(e,t),this}sendValueToGuest(t,r){this.guestDisposed(t,r)||e(t,r)}guestDisposed(e,t){return!!t.disposed?.(e)&&(this.remove(t),!0)}}var l=Object.defineProperty,d=(e,t,r)=>((e,t,r)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class v{constructor(e){d(this,"guests",new Set),d(this,"patronPool"),this.patronPool=new a(e)}give(e){return this.deliverToGuests(e),this.patronPool.give(e),this}add(e){return"function"!=typeof e&&e.introduction&&"guest"!==e.introduction()||this.guests.add(e),this.patronPool.add(e),this}remove(e){return this.guests.delete(e),this.patronPool.remove(e),this}distribute(e,t){return this.add(t),this.give(e),this}size(){return this.patronPool.size()+this.guests.size}deliverToGuests(t){this.guests.forEach((r=>{e(t,r)})),this.guests.clear()}}class g{constructor(e){if(this.theValue=e,void 0===e)throw new Error("GuestSync didnt receive theValue argument")}give(e){return this.theValue=e,this}value(){return this.theValue}}class w{constructor(e){if(this.baseGuest=e,void 0===e)throw new Error("GuestObject didnt receive baseGuest argument")}give(e){let t=this.baseGuest;return"function"==typeof t&&(t=new r(t)),t.give(e),this}introduction(){return"function"!=typeof this.baseGuest&&this.baseGuest.introduction?this.baseGuest.introduction():"guest"}disposed(e){const t=this.baseGuest;return!!t.disposed&&t.disposed(e)}}class p{constructor(e,t){if(this.guest=e,this.disposeCheck=t,void 0===e)throw new Error("GuestDisposable didnt receive guest argument");if(void 0===t)throw new Error("GuestDisposable didnt receive disposeCheck argument")}disposed(e){return this.disposeCheck(e)}give(t){return e(t,this.guest),this}}class f{constructor(e,t){this.baseGuest=e,this.applier=t}give(t){return e(this.applier(t),this.baseGuest),this}}var b=Object.defineProperty,m=(e,t,r)=>((e,t,r)=>t in e?b(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,t+"",r);class y{constructor(t,r){m(this,"give"),this.give=r((r=>e(r,t)))}}class E{constructor(e){if(this.willBePatron=e,void 0===e)throw new Error("Patron didnt receive willBePatron argument")}introduction(){return"patron"}give(t){return e(t,this.willBePatron),this}disposed(e){const t=this.willBePatron;return t?.disposed?.(e)||!1}}const P=e=>"object"==typeof e&&null!==e&&"patron"===e?.introduction?.();var G=Object.defineProperty,S=(e,t,r)=>((e,t,r)=>t in e?G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,t+"",r);class A{constructor(e){if(this.baseGuest=e,S(this,"received",!1),void 0===e)throw new Error("PatronOnce didnt receive baseGuest argument")}introduction(){return"patron"}give(t){return this.received||(this.received=!0,e(t,this.baseGuest)),this}disposed(e){if(this.received)return!0;const t=this.baseGuest;return!!t.disposed&&t.disposed(e)}}var j=Object.defineProperty,F=(e,t,r)=>((e,t,r)=>t in e?j(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,t+"",r);class O{constructor(e,t){F(this,"guestApplied"),this.guestApplied=new f(e,t)}give(e){return this.guestApplied.give(e),this}introduction(){return"patron"}}var D=Object.defineProperty,k=(e,t,r)=>((e,t,r)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,t+"",r);class z{constructor(e,t){k(this,"guestApplied"),this.guestApplied=new y(e,t)}give(e){return this.guestApplied.give(e),this}introduction(){return"patron"}}var K=Object.defineProperty,V=(e,t,r)=>((e,t,r)=>t in e?K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class C{constructor(e){this.sourceDocument=e,V(this,"thePool",new a(this)),V(this,"theEmptyPool",new a(this)),V(this,"isEmpty"),this.isEmpty=void 0===e}pool(){return this.thePool}give(e){return this.isEmpty=!1,this.sourceDocument=e,this.thePool.give(this.sourceDocument),this.theEmptyPool.give(this.sourceDocument),this}value(e){return this.isEmpty?(P(e)&&this.theEmptyPool.add(e),this):("function"==typeof e?this.thePool.distribute(this.sourceDocument,new r(e)):this.thePool.distribute(this.sourceDocument,e),this)}filled(){return!this.isEmpty}}var x=Object.defineProperty,T=(e,t,r)=>((e,t,r)=>t in e?x(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);class B{constructor(e=[]){T(this,"theAll"),T(this,"keysKnown"),T(this,"keysFilled",new Set),T(this,"filledAllPool",new v(this)),this.theAll=new C({}),this.keysKnown=new Set(e)}valueArray(e){const t=new w(e);return this.filledAllPool.add(new i(t,(e=>{t.give(Object.values(e))}))),this.isAllFilled()&&this.theAll.value(new r((e=>{this.filledAllPool.give(Object.values(e))}))),this}value(e){const t=new w(e);return this.isAllFilled()?(this.filledAllPool.add(t),this.theAll.value(new r((e=>{this.filledAllPool.give(e)})))):this.filledAllPool.add(t),this}guestKey(e){return this.keysKnown.add(e),new r((t=>{this.theAll.value(new r((r=>{this.keysFilled.add(e);const i={...r,[e]:t};this.theAll.give(i),this.isAllFilled()&&this.filledAllPool.give(i)})))}))}isAllFilled(){return this.keysFilled.size>0&&this.keysFilled.size===this.keysKnown.size}}function M(e,t){if(void 0===e)throw new Error("value didnt receive source argument");if(void 0===t)throw new Error("value didnt receive guest argument");return"function"==typeof e?e(t):e.value(t)}function q(e){if(void 0===e)throw new Error("isSource didnt receive mbSource argument");return"function"==typeof e||"function"==typeof e?.value}class I{constructor(e){if(this.source=e,void 0===e)throw new Error("Source constructor didnt receive executor function")}value(e){return M(this.source,e),e}}const N=t=>new I((r=>e(t,r)));class R{constructor(e,t){if(this.baseSource=e,this.targetSource=t,void 0===e)throw new Error("SourceSequence didnt receive baseSource argument");if(void 0===t)throw new Error("SourceSequence didnt receive targetSource argument")}value(t){const r=new B,s=new C,o=this.targetSource.get(s);return M(this.baseSource,new i(t,(i=>{let n=0;const u=()=>{void 0!==i[n+1]?(n+=1,c()):r.valueArray(t)};function c(){s.give(null);const e=i[n];q(e)?M(e,new A((e=>{s.give(e),M(o,r.guestKey(n.toString())),u()}))):(s.give(e),M(o,r.guestKey(n.toString())),u())}void 0!==i[n]?c():e([],t)}))),this}}class H{constructor(e,t){if(this.baseSource=e,this.targetSource=t,void 0===e)throw new Error("SourceMap didnt receive baseSource argument");if(void 0===t)throw new Error("SourceMap didnt receive targetSource argument")}value(t){const r=new B;return M(this.baseSource,new i(t,(t=>{t.forEach(((t,i)=>{const s=q(t)?t:new I((r=>{e(t,r)}));M(this.targetSource.get(s),r.guestKey(i.toString()))}))}))),r.valueArray(t),this}}class J{constructor(e){if(this.sources=e,void 0===e)throw new Error("SourceRace didnt receive sources argument")}value(t){let r=null;return this.sources.forEach((s=>{M(s,new i(t,(i=>{r&&r!==s||(e(i,t),r=s)})))})),this}}var L=Object.defineProperty,Q=(e,t,r)=>((e,t,r)=>t in e?L(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,t+"",r);class U{constructor(e){if(this.configExecutor=e,Q(this,"source",new C),void 0===e)throw new Error("SourceActive constructor didnt receive executor function")}do(e){return this.configExecutor(e,this.source),this}value(e){return this.source.value(e),this}}class W{constructor(e,t){if(this.baseGuest=e,this.baseSource=t,void 0===e)throw new Error("SourceDynamic didnt receive baseGuest argument");if(void 0===t)throw new Error("SourceDynamic didnt receive baseSource argument")}value(e){return M(this.baseSource,e),this}give(t){return e(t,this.baseGuest),this}pool(){throw Error("No pool in SourceDynamic")}}class X{constructor(e,t){this.baseSource=e,this.applier=t}value(t){return M(this.baseSource,new i(t,(r=>{e(this.applier(r),t)}))),this}}var Y=Object.defineProperty,Z=(e,t,r)=>((e,t,r)=>t in e?Y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,t+"",r);class ${constructor(e,t){Z(this,"value"),this.value=t((t=>{M(e,t)}))}}var _=Object.defineProperty,ee=(e,t,r)=>((e,t,r)=>t in e?_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,t+"",r);class te{constructor(e){ee(this,"source"),this.source=new C(e)}value(e){return M(this.source,e),this}give(e){return this.source.filled()||this.source.give(e),this}pool(){return this.source.pool()}}class re{constructor(e,t={}){if(this.constructorFn=e,this.modules=t,void 0===e)throw new Error("PrivateClass didnt receive constructorFn argument")}get(...e){return new this.constructorFn(...e,this.modules)}}class ie{constructor(e){if(this.buildingFn=e,void 0===e)throw new Error("Private didnt receive buildingFn argument")}get(...e){return this.buildingFn(...e)}}export{r as Guest,f as GuestApplied,i as GuestCast,p as GuestDisposable,y as GuestExecutorApplied,w as GuestObject,v as GuestPool,g as GuestSync,E as Patron,O as PatronApplied,z as PatronExecutorApplied,A as PatronOnce,a as PatronPool,ie as Private,re as PrivateClass,I as Source,U as SourceActive,B as SourceAll,X as SourceApplied,W as SourceDynamic,$ as SourceExecutorApplied,H as SourceMap,te as SourceOnce,J as SourceRace,R as SourceSequence,C as SourceWithPool,e as give,t as isGuest,P as isPatron,h as isPatronInPools,q as isSource,u as patronPools,c as removePatronFromPools,N as sourceOf,M as value};
|
2
2
|
//# sourceMappingURL=patron.min.mjs.map
|